Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
First, you are accumulating the frames in $gifdata .= $frame->gifanimadd;, but then you print just the header info from the image into the file: print F $img->gif();. You should be printing the accumulated headers and frame data to the file: print F $gifdata;
Silly me, of course, I was doing it wrong. It is all working now, many thanks. Oh, and GD is about an order of magnitude faster than Imager. This would make a significant difference when I work with real data... 100 years worth (iow, 100 frames) of a few hundred thousand to a couple of million cells.
That doesn't affect a complete fix though because you're also confusing what constitutes a frame and what a complete animation. That is, you appear to be drawing a complete set of moving rectangles into each frame, rather than one rectangle at a different position in each frame.
No, thankfully, I got that part right.

Now I have to figure out whether an animated gif is appropriate for me (pretty universal readability... all browsers can), or if I should go the route of HTML5 video. What I would really like is a user-controllable scrub/scroll bar so the time-lapse can be changed to any time period. But, that is not a perl problem...

Many thanks again.

--

when small people start casting long shadows, it is time to go to bed

In reply to Re^2: Creating an animated gif with GD by punkish
in thread Creating an animated gif with GD by punkish

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others chanting in the Monastery: (10)
    As of 2015-07-07 09:50 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









      Results (88 votes), past polls