
Generation Loss
8 months ago
Open the last saved jpeg image
Save it as a new jpeg image with slightly more compression
Repeat 600 times
Code is here if you want:
hadto.net/category/sketchbook/generation-loss
Save it as a new jpeg image with slightly more compression
Repeat 600 times
Code is here if you want:
hadto.net/category/sketchbook/generation-loss
-
Vimeo: About / Blog / Developers / Jobs / Community Guidelines / Community Forums / Help Center / Site Map / Merchandise
/ Get Vimeo

Previous Week
(stunning!)
Nice video.
okay, then i'm becalmed. congrats for that idea and the scripting skillz.
looks very van gogh-y.
en.wikipedia.org/wiki/Generation_loss
That article makes it seem that its not the compression level that matters but the change in compression level with every save that leads to maximum generation loss. So I tried to do the same thing with random a compression level chosen with each file save and it looks very different, it's certainly a better way to wreck a jpeg. I didn't like the way it looked as much and chose this instead.
Question, though: are you increasing the compression during this, or are you just setting it at the same quality level (say, 50 or 60) and running it over and over?
Just curious! Thanks for this awesome study!
compression = map(i, 0, 600, 1, 0)
where
i is the current iteration
0 - 600 is the number of iterations
and 1 - 0 is the compression of the jpeg 1 being no compression and 0 being maximum compression.
plan9.bell-labs.com/cm/ms/what/shannonday/shannon1948.pdf
RT
online-privacy.pro.tc
When using "slightly more compressio" with
compression = map(i, 0, 600, 1, 0)
you are deliberately smashing the picture.
Let me show you:
As iterations go on, "i" grows until 600, and the returned value from map call decreases towards "0".
So, as iterations go on, you are using a worse quality recompressing for an already an already degraded image. On the last step you save as quality 0 from an image wich has already been smashed out by previous low quality compresions.
You are deliberately lossing quality on every step, but you are even loosing more quality on each step than in previous one. What did you spect to get from that process ?
$file = 'chicago_hdr_west02_1280.jpg';
$im = imagecreatefromjpeg($file);
$i = 0;
for ($q=100; $q>0; $q--) imagejpeg($im, "out_".(++$i).".jpg", $q);
then to make a movie:
ffmpeg -r 10 -b 180000 -i out_%d.jpg test.mp4
I think most of people wide the internet mis-understood your point as being demostrating jpeg degradation effect when saving once and again, like
Brad Miller did:
"wow, I'm switching to RAW after seeing this!"
Brad, you'd better use RAW, but not because of this test.
Also, hadto, as far as you apply more compresión over already compressed images, you are exponentially degrading the image. Brian More was right.
Save it as a new jpeg image with slightly more compression
Repeat 600 times
that's all, this was not meant to teach people how to save a jpeg.
compression level is linear regardless of wether the over all compression is exponential or not.
map = linear
The quality level parameter would indeed be linear if you applied it to the *original* image at each iteration, i.e. q_i = (1 - i/600). By applying it to the *previous* image, you have something else.
Regardless, what people are really interested is in seeing the effect of saving a jpg repeatedly at a *fixed* quality level (say 0.8).
Care to put together a small video on *that?*
vimeo.com/3860779
(BTW saved at 0.8)
From what I understand, the JPEG algorithm cuts some frequencies in the image, so once they are cut there is nothing else to do. In practice, it does stabilize after a few steps (there are some rounding effets possibly), check with the md5 scripts on that page.
So, the new video is correct. "Nothing happens," indeed.
Boring, isn't it? ;-)
Here´s a video made with a code error provocated
vimeo.com/5014465
greetings!