TJ: Do scan lines decrease the filesize of an animated gif?
(,
Sun 10 Oct 2004, 19:24,
archived)
Good to know. I'll have to try it out.
Edit: I've tried it out on this and it went down to 138kb from 220kb. Colour me impressed.
(,
Sun 10 Oct 2004, 19:27,
archived)
Edit: I've tried it out on this and it went down to 138kb from 220kb. Colour me impressed.
makes it smaller too. if you tried it with vertical lines it wouldnt work too well.
(,
Sun 10 Oct 2004, 19:34,
archived)
gifs make each colour into a letter. if you have a photo, it'll say a,b,c,d for each pixel for example. if they're all the same colour it'll be a,a,a,a which is shortened to 4a.
it works horizontally, so a black line would become 280a instead of a,b,2a,b,c,3d,e etc etc etc etc
(,
Sun 10 Oct 2004, 19:37,
archived)
it works horizontally, so a black line would become 280a instead of a,b,2a,b,c,3d,e etc etc etc etc
The actual codes that end up in a gif that has a solid black line in it would look 1a, 2a, 3a, 4a, 5a, 6a, etc. though I forget why that is.
The gif is treated as one long string, wrapping at the end of lines. (it also clears the code table and starts again every so manybytes codes, 4095 I think.) So if you could align the black scanlines with the sequences of colours that get encoded, you'd get even better compression. This is presumably what lossy gif optimisation does, which is why you get seemingly random bits of horizontal line everywhere on a highly compressed gif.
Since it's sequences of colours that are encoded, you could also potentially optimise the gif using multi-coloured scan lines.
(,
Sun 10 Oct 2004, 19:50,
archived)
The gif is treated as one long string, wrapping at the end of lines. (it also clears the code table and starts again every so many
Since it's sequences of colours that are encoded, you could also potentially optimise the gif using multi-coloured scan lines.
Here are the results for this animation:
Original size: 220kb
Horizontal scan lines (1 pixel wide): 138kb
Vertical scan lines (1 pixel wide): 154kb
(,
Sun 10 Oct 2004, 19:38,
archived)
Original size: 220kb
Horizontal scan lines (1 pixel wide): 138kb
Vertical scan lines (1 pixel wide): 154kb
i'm surprised vertical scan lines reduced the size that much.
Its good to play around with stuff like that, good way to learn how to keep animations small and tidy
(,
Sun 10 Oct 2004, 19:41,
archived)
Its good to play around with stuff like that, good way to learn how to keep animations small and tidy