GIF images compress files using a row-based algorithm called LZW. While this compression is lossless, it has trouble compressing vertical lines in images to the same magnitude as horizontal lines.
To test this, I created a GIF with 4 horizontal lines. It was saved with the following specifics:
- Index of 2 colors
- No dithering
- No transparency
- No interlacing
I then rotated the image 90 degrees and saved it again with the same specifications.
GIF File Sizes
The horizontal image was 391bytes, while the vertical was 1.23KB -- 3 times larger. The only difference was the rotation of the stripes.
The diagonal striped image in this gallery was created using the same base file, but I can't guarantee that there is the same amount of red color in the image. Even so, the image was 1.36KB larger than the horizontal image.
Optimizing GIF Images
If you want to optimize GIF images, you should minimize the amount of vertical lines in the image, in favor of horizontal.
Images 1-3 of 3
|Horizontal Lines in a GIF||Vertical Lines in a GIF||Diagonal Lines in a GIF|
- Graphic Index
- Text Index