Perl Monk, Perl Meditation | |
PerlMonks |
Re^3: Why is Tk::Animation so slow? (re: glitches)by vr (Curate) |
on Dec 23, 2019 at 11:44 UTC ( [id://11110545]=note: print w/replies, xml ) | Need Help?? |
Ah, I knew it: code runs with result (almost) as expected on 1st attempt: no errors, no typos even. Then something _must_ be wrong with it:). Because of those "glitches" I said "almost" and "didn't investigate", though I should have :) First thing, "copy" method doesn't copy gif tags (bug in Imager?), $trans_idx was undefined, mask always blank. However, "compose" method apparently works, even if source image is converted to 3 channel RGB (no alpha) with "to_rgb8", and mask attribute not supplied at all. Statement in fragment further below could be replaced with
and animation would still work. Where and why Imager gets transparency information in this case -- I don't know. I'd expect the result be the same as with "paste" method (you can try it if you wish -- that's where there are no masks, no transparency). Further, I should have checked for offsets of gif frames -- they are not always zero. Whole "if else" fragment can be replaced with the following (though mask may be unnecessary(?), I'm not omitting it):
In Section
Seekers of Perl Wisdom
|
|