Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re^2: reversed colors png images.

by Anonymous Monk
on Dec 18, 2013 at 15:52 UTC ( #1067645=note: print w/replies, xml ) Need Help??

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 (Pope) 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)?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1067645]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2018-04-25 22:19 GMT
Find Nodes?
    Voting Booth?