You are not logged in. Login or Signup
Home » Messageboard » XXX » Message 3806333 (Thread)

# someone mentioned the fact that its horizontal lines
makes it smaller too. if you tried it with vertical lines it wouldnt work too well.
(, Sun 10 Oct 2004, 19:34, archived)
# yeah, i was about to comment on that, but realised it'd be too geeky
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)
# ahaa
all is now clear
(, Sun 10 Oct 2004, 19:39, archived)
# It's sequences of colours that are made into letters.
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 many bytes 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)
# again
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)
# oh
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)
# only problem is that your animations look identical to everyone else's ;)
(, Sun 10 Oct 2004, 19:42, archived)
# Thats cos
it's wider than it is tall. Less vertical lines across than horizontal ones down...
(, Sun 10 Oct 2004, 19:43, archived)