Re: setting a transparent color on a pixbuf for Canvas layering



* muppet <scott asofyet org> [2008-07-01 06:25]:
In perl, it's a bit more difficult to manage a GdkPixbuf's
image data. You could write some XS to do it in C with speed
and ease, but then you have XS code to deal with. You could
write it in perl and deal with a map-reduce and unpack and pack
and all the fun stuff there, and hope you can get the speed
reasonable.

Or, just use GD, which has already solved the problem for you.

Or you can use it as an opportunity to learn PDL, which is what
kids these days would call a DSL, for manipulating just that sort
of data stored linearly in memory with performance much like that
of C, in Perl.

Of course youâll have to write more code that way, and thereâs a
somewhat steep learning curve to climb if youâve never used PDL
before. For byte-pushers itâs worth the time, though.

Oh, and if youâre not going to do that, you could check out the
Imager module as an alternative to GD which I find a whole lot
nicer than GD in a whole lot of ways.

Regards,
-- 
Aristotle Pagaltzis // <http://plasmasturm.org/>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]