I recently mocked up a simple, greyscale graphic design in Gimp for some small advertisements I was having printed. For the sake of the printer, I laid out and exported a sheet of them to PDF. (through Open Office’s Writer)
It caught my eye that the pdf exported to about 134kb, while the 300dpi, greyscale, jpeg image it contains bears a file size of 256kb. I exported with lossless compression, and I understand what lossless compression is, thank you, but I still find it all a little magical.
For a comparison I tried zipping (and 7z’ing) the jpeg, which reduced it to 217kb. I have to admit that I didn’t expect it to do that much, even. Its been my previous experience that jpeg’s tend to get outputted as small as they’ll go in the first instance. I mean, compressing a jpeg is essentially compressing a compressed file. So if there’s still headroom, something’s gone awry somewhere, right? Even at 100% quality, saving to the jpeg format should achieve a, more or less, lossless compression itself, right? Why wouldn’t it, for Pete’s sake?
But even dismissing that little digression, how the hell did Open Office’s writer manage to squeeze my 256kb image down to 134kb without dropping an ounce of quality?! I have to imagine that it not only compressed, but even converted the image to a different, more efficient, internal file-format.
Could it be that the export process is so unusually intelligent that it realized my image had so few colors that it might benefit by an indexed palette?! and so converted my image to something more akin to a gif, thereby cutting the file size in halfx0rz!? And if so, where can I download this fantastic algorithm capable of determining and outputting the most efficient file format automagically? And why isn’t it included in all the tools I already use?!
[color=red][size=1]modEdit: That part wasn’t necessary.[/size][/color]
Are PDFs really made of magic, or what?