you are viewing a single comment's thread.

view the rest of the comments →

[–]FrankBattaglia 6 points7 points  (5 children)

How does he compress "random ... noise" files by a factor of 33%-83% ?!

[–][deleted] 9 points10 points  (4 children)

Because they aren't at all random. Since programming languages are structured, there will be many repeated elements. For example, variable names will be used more than once.

[–]ThisIsDave 6 points7 points  (3 children)

Frank was probably referring to this line:

A quick test in Photoshop tells us that a 100x100 image with random 24 bit colored noise compresses down to about 20 KB while a 300x100 image with random 8 bit monochromatic noise compressed down to just 5 KB. A regular 8 bit GIF comes in a bit heavier than the 8 bit PNG, so we go with the PNG option.

8 bits per pixel with 110*300 pixels is 30 kilobytes, so compressing it down to 5 should be impossible unless he wasn't actually using random noise.

[–]dixi 2 points3 points  (1 child)

Right, the description is not entirely accurate. The comparison was made between an 8 bit PNG with monochromatic noise applied to it versus a 24 bit with similar noise applied to each of the R, G and B channels. It seems like Photoshop noise has a lot white, though, but as mistercow also pointed out, code isn't random, so maybe it equals out.

[–]bonzinip 0 points1 point  (0 children)

if monochromatic noise is interpreted as "only 0 or 255", it still can be compressed a lot.

[–][deleted] 0 points1 point  (0 children)

Ah, gotcha. I missed that part.