<p>I want to create an animated GIF, but instead of 8-bit 256 colours, my data is comprised of binary bitmaps of black/white pixels.</p>
<p>Can GIF accommodate this, or are pixels in GIF always 8-bit indices?</p>
<p>I need the resulting GIF to be small in size, so I cannot afford to waste 7 of the 8 bits.</p>
<p>If GIF does not support this, is there any other file format that would allow me to do this?</p>
<p>I believe that TIFF supports 1-bit images, but I've never seen an animated TIFF file.</p>

CC BY-SA 4.0
2022-07-27T16:55:57.093Z
"*I need the resulting GIF to be small in size, so I cannot afford to waste 7 of the 8 bits.*" What makes you think that is what would happen? GIF uses *compression*, not just paletting. Maybe you should compress your image with GIF and see if it is "too big" for you.
Nicol Bolas
CC BY-SA 4.0
2022-09-05T09:25:56.830Z
It's been a *very* long time (cough ~35 years) since I was experimenting with writing a GIF compressor, but IIRC, if the colour table has between 2^(N-1)+1  and 2^N entries, then I *think* it will initially use N bits to index into that table (and gradually increase as it builds up strings of symbols).  ...  but take with a grain of salt.
Simon F
<animation><raster-image><bitmap-graphics>
Animated bitmaps with 2 colours only
Bram
# Animated bitmaps with 2 colours only

(Asked by: username_0 on 2022-07-27)

I want to create an animated GIF, but instead of 8-bit 256 colours, my data is comprised of binary bitmaps of black/white pixels.

Can GIF accommodate this, or are pixels in GIF always 8-bit indices?

I need the resulting GIF to be small in size, so I cannot afford to waste 7 of the 8 bits.

If GIF does not support this, is there any other file format that would allow me to do this?

I believe that TIFF supports 1-bit images, but I've never seen an animated TIFF file.

**Tags:** animation, raster-image, bitmap-graphics

> **Comments:**
> **username_1**: "*I need the resulting GIF to be small in size, so I cannot afford to waste 7 of the 8 bits.*" What makes you think that is what would happen? GIF uses *compression*, not just paletting. Maybe you should compress your image with GIF and see if it is "too big" for you.  
> **username_2**: It's been a *very* long time (cough ~35 years) since I was experimenting with writing a GIF compressor, but IIRC, if the colour table has between 2^(N-1)+1  and 2^N entries, then I *think* it will initially use N bits to index into that table (and gradually increase as it builds up strings of symbols).  ...  but take with a grain of salt.  

---

## 0 answers

