jaapv@accucx.cc.ruu.nl (Jaap Verhage) (01/24/91)
Recently, the program Alchemy was posted to alt.sex.pictures. As I was rather impressed by the included file SAMPLE.JPG, I decided to try out the program on some GIF files. I chose two: one from alt.sex.pictures, KATYA3.GIF, showing a naked masturbating girl with lots of nicely tanned skin-tones (among other things). I guess this is a scan of a color photograph. The second file is a raytraced picture made by Dkbtrace from a modified version of its sample input file, WINDOW.DAT. The output was a Targa file, which was converted to GIF by Piclab version 1.82 with dithering off and called WINDOWJV.GIF. The picture contains a uniformly blue globe on a brown wooden floor; in the globe, a white windowpane is reflected, as well as some of the floor. Both GIF files are 640x480 pixels, 256 colors. What I did comes down to this: I compressed the pictures with Alchemy on my PC, using various quality settings, resulting in compressed files with the extension .JPG. I then decompressed them back into GIFs and viewed them with Cshow version 8.21b. I marked compression and decompression times and ratios and formed an opinion about the quality of the resulting GIFs, compared to the originals. Quality settings used were 1, 16, 32, 48, 64, 80, and 96. I tried compressing with dithering on (the default) and with dithering off. For the other options, I used the defaults; naturally, I indicated I wanted a GIF file when decompressing. Results of all this, on a 12 MHz Laser AT clone with a 40 MB hard disk, 28 msec access time were as follows. 1. The compression ratio of Alchemy is impressive, no doubt about that - if you choose the right file to compress. Sizes of the .JPG files generated from KATYA3.GIF by Alchemy were from 6 to 48% (dithering on) and 5 to 45% (dithering off) of the original GIF file size: 145244 bytes. However, trying the same thing on WINDOWJV.GIF turned out different results: sizes of the .JPG files were from 16 to 123% (dithering on or off made essential- ly no difference) of the original size, 44916 bytes. Generally, the .JPG files get bigger if you set a higher quality setting while compressing, which I would expect: the more information you try to retain, the more has to be stored, right? But making a compressed file bigger than its original goes a bit too far, in my opinion. 2. Compression times: for KATYA3.GIF, these ranged from 110 to 127 seconds with dithering on, and from 115 to 126 seconds with dithering off. For WINDOWJV.GIF, the timings were from 108 to 117 seconds (dithering on) and from 109 to 118 seconds with dithering off. Compression times grow with increasing quality settings. 3. Now, if you decompress the .JPG files back into GIFs, interesting things happen. For KATYA3.GIF, resulting file sizes were from 48 to 103% (dithering on in the .JPG file) and from 46 to 97% (dithering off) of the original GIF file size. For WINDOWJV.GIF, these figures ranged from 109 to 286% (dithering on or off in the .JPG files made essentially no differen- ce). Yes, 286%! That's almost *three* times as big as the original. 4. Decompression times: from 289 to 334 seconds for KATYA3.GIF with dithering on in the .JPG files, from 303 to 338 seconds with dithering on. Decompres- sing WINDOWJV.JPG back to WINDOWJV.GIF lasted from 297 to 325 seconds with dithering on in the .JPG files, and from 297 to 326 seconds if the .JPG files had been made with dithering off. Again, decompression takes longer for a higher quality (and thus, genarally, larger) .JPG file. This means that I could drum my fingers on the table for around 5 minutes waiting for each file to be decompressed. 5. As for quality of the resulting decompressed pictures, the results are rather conflicting. KATYA3.GIF was fairly like its original if I used quality 48 or higher; 32, the default setting, was more than reasonable. However, I did notice differences between the original and *all* of the compressed-and-then-decompressed files. These were more noticeable with dithering on than with dithering off. In both cases, however, small patches of color, different from their surroundings, appeared where these were absent or blended much more smoothly with their surroundings in the original. Furthermore, a higher quality setting when compressing didn't always produce better results in the decompressed files. Let me say, however, that I studied the pictures fairly extensively (it's remarkable how the erotic effect wanes when you do this :-)); a casual observer might not notice all the differences I did. WINDOWJV.GIF produced bad results, period. Worse with dithering on than with dithering off, but still bad with dithering off. Particularly borders between two regions of uniform color came out blurred and distorted, `noisy' I'd say. 6. Coming to conclusions: I won't be using Alchemy in the future to store GIF files in compressed format. For me, the differences between the original files and their compressed-and-then-decompressed counterparts are too noticeable. However, there is an option in Alchemy to produce a so-called `uniform pallette'; I haven't used this, as I don't know what it's for (the documentation doesn't make this clear to me) and it may change my ideas. If I try it, I'll post the results to this newsgroup. 7. Anyone care to share some light on these observations? E.g., why does WINDOWJV.GIF, when compressed-and-then-decompressed, come out much bigger than the original file? Any reason why Alchemy should do better on a scan of a photograph (KATYA3.GIF) than on a raytraced image (WINDOWJV.GIF)? I can imagine something to do with sharply defined borders between two adjacent areas of uniform color; these will allways be *somewhat* blurred in a scan of a photograph, but not necessarily so in a raytraced image, and certainly not in the one I used. 8. Today, I found three images in alt.sex.pictures intended to demonstrate the effects of JPEG compression on a GIF file: the original file, and two GIF files decompressed from a `medium quality' and a `high quality' compressed version of the original. In my opinion, the quality of the original was so bad (200x200 pixels, 256 colors, containing a girl's face) that I can't take it seriously as a yardstick to measure the effects of JPEG compression by. -- Regards, Jaap. Jaap Verhage, Academic Computer Centre, State University at Utrecht, Holland. jaapv@cc.ruu.nl +<-*|*->+ I claim *every*thing and speak for myself