Skip to content

Animated GIF generation / streaming with PHP

Here’s an example of animated GIF generation using PHP.

In this particular case I’m sending the first frame to the browser really quickly, so the browser can render the size of the image correctly, then while the browser waits for more data I do some processing (which can take 10 seconds) and send the rest of the GIF once completed.

The result are some “Recent Sales” images I can use on item pages like this:

Version 1: Animated image stats slider:

Version 2: Separate images that fade-in once the data has been calculated server side:



A demo of these is available on the UCM Pro item page.

Code is here: https://github.com/dtbaker/envato-live-sales-gif

Published inEnvatoWeb Development

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

© dtbaker.net