b3ta.com board
You are not logged in. Login or Signup
Home » Messageboard » Photoshop Ducks » Message 4209865

[challenge entry] Bloody Optimisation.

Edit: better now, thanks to Lanc and his optimisation skills

From the Photoshop Ducks challenge. See all 515 entries (closed)

(, Sun 30 Jan 2005, 22:46, archived)
# run runrunrun
from the Goose...
(, Sun 30 Jan 2005, 22:46, archived)
# ooh, nice!
have you tried doing one with a missile or somesuch?
(, Sun 30 Jan 2005, 22:49, archived)
# nope
i thought the duck was cooler!
(, Sun 30 Jan 2005, 22:49, archived)
# but..but...
you could make a hoax of your town/block/village/uni being invaded or something equally silly
(, Sun 30 Jan 2005, 22:51, archived)
# BLAM!
cool.
(, Sun 30 Jan 2005, 22:49, archived)
# heh heh heh
i actually like the fact that it's dark... makes kit look like an old school war film
(, Sun 30 Jan 2005, 22:50, archived)
# "General, the Ducks are attacking again"
"those bastards"
"DUCK...... FOR COVER"
(, Sun 30 Jan 2005, 22:51, archived)
# "Sarge, it's wilikins!"
"what's happened godber?"
"i'm afraid he took shrapnel from an errant mallard sarge"
"goddamn those ducks, will these horrors never cease?"
(, Sun 30 Jan 2005, 22:55, archived)
# best bit about this was diving over a 6' wall and bouncing back into shot in the full video
/has a sore arm
(, Sun 30 Jan 2005, 22:59, archived)
# haha!
yay!
(, Sun 30 Jan 2005, 22:51, archived)
# DUCK!
(, Sun 30 Jan 2005, 22:52, archived)
# who knew
geese explode on impact?

woo!
(, Sun 30 Jan 2005, 22:52, archived)
# I did
hence why i ran
(, Sun 30 Jan 2005, 22:54, archived)
# oooh,
yer a right smart young fella, you are!
(, Sun 30 Jan 2005, 23:02, archived)
# sometimes i thunk
(, Sun 30 Jan 2005, 23:04, archived)
# Hehe..it works!
(do the scan lines optimise it that much?..just wondering)
(, Sun 30 Jan 2005, 22:53, archived)
# from way over a meg to 200 i think so in this case
(, Sun 30 Jan 2005, 22:53, archived)
# Cool!
..will have to try that next time I'm facing producing a monster gif!
(, Sun 30 Jan 2005, 22:55, archived)
# gifs compress by counting the number of identical pixels of a colour in a horizontal line
so a solid line of black takes up very very little space

edit: to quote claws of doom

A GIF is mostly used on the web for logos, lines and one pixel images. It is the only image format that can handle animations on the internet (not discussed here). GIFs are limited (by their definition) to be able to handle at most 256 colours. This means that they cannot accurately display photographic images (which need 256 colours in each base colour: Red, Green and Blue).

To store an image as a GIF, the following steps are taken.

1. The image is analyzed to see which set of colours (up to 256 different ones) will best describe the colours present.
2. The colours are defined and each tagged with a different key (colour a, b, c etc. if you will)
3. The lines of the picture are placed end to end, with the topmost line first.
4. Each individual pixel is then described. This generates a line of data which could appear as "a,b,a,a,a,c,b,a,a,b,b,b,b,c,a" etc.
5. This is compressed to: "a,b,3a,c,b,2a,4b,c,a" etc.

From this you can see that a large swathe of the same colour takes up very little space – imagine the section compressed by "2478a". These large swathes of colour occur mostly in logos and blocks of colour. Even the slightest change of shade between pixels will render the compression useless.

Given the original picture dimensions the image can be worked out again, by merely reading the list of data and laying each pixel down – much like a mosaic. If the image had less than 256 colours in it at the start, you wouldn't have lost any detail in your image by storing it as a gif.
(, Sun 30 Jan 2005, 22:57, archived)
# Of course!
But what a superb explaination! (Thank you!)
(, Sun 30 Jan 2005, 23:01, archived)
# yep... i'm mighty glad he took the time to write that
it's much better than the one i wrote
(, Sun 30 Jan 2005, 23:03, archived)
# it's called Run Length Encoding
although it's possible to RLE optimize your image in a very lossy way so that near duplicatable colours are made identical,
however unlike the squares that appear in wavelet compression (jpeg), this optimization loss is highly noticable
(, Sun 30 Jan 2005, 23:25, archived)
# Nicely done!
Woo!
(, Sun 30 Jan 2005, 22:54, archived)
# woo
Alfred Hitchcock's the birds looks like a teletubbies episode compared to this, lets see that blond run from that fucker
(, Sun 30 Jan 2005, 22:54, archived)
# that's ace!
and i think it's the scanlines that make it so big
(, Sun 30 Jan 2005, 23:08, archived)