Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

comment on

( [id://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":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (5)
As of 2024-03-29 13:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found