It's all about optimization

1.1.4 Optimize horizontal uniformity

LZW compression looks for sequences of identical pixels appearing in sequence. GIF images are saved as horizontal rows; hence a GIF with horizonal uniformity will compress better than one without.

The following example says it all:


GIF image: 126 bytes


same image, rotated 90°: 205 bytes