Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Converting animated .gif to HTML5?

Featured Replies

Hi all,

 

I have a few quirky flash animations on a website, however they don't show on iPad or iPhone. I was thinking about making them as animated .gif as they are very short animations, with only one colour used.

 

However, I ideally need them to have a transparent background, and this looks horrid without PNG-24!

 

I don't think the animation would be achievable using CSS3. Is there a way to create animations using HTML5?

 

The animation is of a hand, in which the fingers wriggle!

  • Author

ah yes I thought <canvas> might be one of the possible solutions. Is it pretty tricky to get your head around?

Edited by C A R

Canvas is probably the best way to perform the task and several jQuery plugins exist to make sprite animation fairly simple. The only other alternative is the APNG (animated png) format but not all browsers support this just yet.

 

 

Do you have a link for the gif version?.. with no gradients the image should animate reasonably well.

Edited by Sogo7

  • Author

Canvas is probably the best way to perform the task and several jQuery plugins exist to make sprite animation fairly simple. The only other alternative is the APNG (animated png) format but not all browsers support this just yet.

 

 

Do you have a link for the gif version?.. with no gradients the image should animate reasonably well.

 

here's the .gif hand on a coloured background https://dl.dropbox.com/u/43279823/hand-sequence-seq-blue.gif

 

ideally, it needs to be on a transparent background, however it then ends up looking choppy, like here https://dl.dropbox.com/u/43279823/hand-sequence-seq.gif

Ahh.. I see the problem. The gif image looks 'choppy' because there are only 15 frames. Flash of course works out the inbetween frames hence the more fluid look.

 

The individual finger elements could drawn and moved purely with code using canvas but at a guess that could be a messy block of code.

 

An old school alternative method would be compile the SWF as a FLV then step through every frame using something like the VLC media player taking a screenshot then build the animated gif that way one frame at a time.

 

Used the above method to build this animated gif a while back,

its 34 frames copied, cropped from a Youtube video.

ani-demo.gif

  • Author

Ahh.. I see the problem. The gif image looks 'choppy' because there are only 15 frames. Flash of course works out the inbetween frames hence the more fluid look.

 

The individual finger elements could drawn and moved purely with code using canvas but at a guess that could be a messy block of code.

 

An old school alternative method would be compile the SWF as a FLV then step through every frame using something like the VLC media player taking a screenshot then build the animated gif that way one frame at a time.

 

Used the above method to build this animated gif a while back,

its 34 frames copied, cropped from a Youtube video.

ani-demo.gif

 

That sounds like it might work well. I might give this a try. Thanks for the advice, and example :)

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.