4

One of the Lint warnings under the "Usability:Icons" header in a recent Lint report included the following message:

GifUsage: Using .gif format for bitmaps is discouraged

(code references omitted)

The .gif file format is discouraged. Consider using .png (preferred) or .jpg (acceptable) instead.

More info: http://developer.android.com/guide/topics/resources/drawable-resource.html#Bitmap

I'm assuming that this is due to the (quality) limitations of the GIF format (e.g. only supports 256 colours), rather than any licensing or technical limitations. Currently, I'm using a couple of GIFs for ease of packaging simple animations into an app.

Is there an "official" explanation link as to why GIFs are discouraged? The reference provided in the Lint output doesn't elaborate on the why.

CJBS
  • 15,147
  • 6
  • 86
  • 135
  • 1
    "Currently, I'm using a couple of GIFs for ease of packaging simple animations into an app" -- depending on what you are using to try to play those animations, it may not work on older devices. There are libraries that play GIF animations IIRC, or you can [convert the GIFs into `AnimationDrawables`](https://commonsware.com/blog/2013/10/01/converting-animated-gifs-animationdrawables.html). – CommonsWare Jul 14 '15 at 22:38
  • @CommonsWare Thanks for the tip; might do that when I have some time. The target device is a custom piece of hardware (i.e. targeted), so older device versions are not a consideration. – CJBS Jul 14 '15 at 22:41
  • Hi, It's just a lint warning. You shouldn't have crashes ryt? – Sheychan Jul 14 '15 at 22:53
  • @Sheychan This isn't causing me a problem; I just want to understand the rationale. – CJBS Jul 14 '15 at 22:56
  • 1
    supports **up to** 256 **distinct** colours – petey Dec 28 '15 at 18:41

0 Answers0