in reply to Re: reversed colors png images.
in thread reversed colors png images.

I'm making an animated gif with perl and i'm using the gd module. I use the newFromPng method to import images. Then i'm working on an animation that looks like:

use GD; $img = GD::Image->newFromPng('test1.png'); $img2 = GD::Image->newFromPng('test2.png'); $img3 = GD::Image->newFromPng('test3.png'); $data = $img->gifanimbegin(1,0); $data.=$img->gifanimadd(0,0,0,1); $data.=$img2->gifanimadd(0,0,0,1); $data.=$img3->gifanimadd(0,0,0,1); $data.=$img->gifanimend; binmode STDOUT; print $data;

I can't provide code to demonstrate my problem.But my problem is that the image colors get mixed up, so the screen starts blinking.

Replies are listed 'Best First'.
Re^3: reversed colors png images.
by BrowserUk (Patriarch) on Dec 18, 2013 at 16:31 UTC
    1. Are your 3 images all the same size?
    2. What is the logic for adding the same image twice with just 1 x 1/100th of a second delay each?
    3. Do you expect to see the animation of 3 images, displayed for 0.02, 0.01 & 0.01 seconds each respectively, to actually visibly move?

    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
Re^3: reversed colors png images.
by Anonymous Monk on Dec 18, 2013 at 16:26 UTC
    Have you tried gifanimadd(1,0,0,1)?