Davids bile giveaway – Images in PDFs or “Maximum compression leads to depression”

First look at this schematic:

The schematic... possibly...

The schematic… possibly…

Now, this is the schematic from a of an evkit for one of the devices of an unnamed company. You’ll note that they used a resistor of a value of… well… 1k? 10? Ah, of course! ͏ԤẨἧ█ ohms.

The problem is that some people do not look at the output that spews out of the PDF converter they use – basically, you can set your converter for maximum quality at a reasonable resolution, which gives you nice crisp images, or you can leave your converter on the default settings, which kind of translates into “I don’t really give a shit or at least I don’t understand what I’m doing”. The default settings will be to compress images in your file to a desperately low resolution and use a lossy compression algorithm. Basically, you get something like this:

A capacitor!

A capacitor!

With the help of my local forensics team I’ve been able to extract the size of the “Plsteo ploturiom” out of the text – it’s “ᾌ=0.2” and “G = 0.2”. You’ll note the fine crisp text – it has been properly inserted into the PDF as text, or at least a vector object. The mechanical drawing itself however has been most likely exported from a printscreen or a bitmap export. When pasted into the editor of your choice it ends up as crap – the editor may downsample it and the PDF converter usually DOES downsample it unless explicitly told not to.

I’ve seen this in a lot of datasheets, app notes and that sort. It’s sad really, that someone works his ass of preparing graphics and at the very end of the process it gets mangled so bad, you can’t make out a cat from a cap. Honestly – graphics mangled in this way are beyond useless – they are infuriating.

Now, how to avoid this? Well, there are several ways – if you’re set on exporting stuff as bitmaps then be sure to use the proper resolution for the PDF conversion. The following example shows the differences:

Comparison between various settings

Comparison between various settings

From top to bottom it’s maximum compression and downsampling to a 100 or so DPI, to something better (still horrible) to a properly set bitmap down to printing directly from a vector file. You’ve probably noticed the difference. If not, there’s no hope for you and you if you work in the general area of graphics than you should quit your job and start writing apology letters.

It might seem that the best thing you can do is set the quality to absolute maximum and set the resolution to 100000 dpi. While this will fix the problem of illegibility, it will certainly make the files bigger. Gargantuan even… and rendering them might take a lot of time even on today’s computers.

To summarize:

  1. Familiarize yourself with the concepts of lossy and lossless compression.
  2. If you have to convert schematics, technical drawings and similar into bitmaps THEN FOR CTHULHUS SAKE, USE LOSSLESS COMPRESSION, otherwise you’ll get a mob of angry engineers wondering whether the blob of pixels in your app note is an inductor, resistor, snake or the death throes of the guy who was drawing the schematic twitching his mouse. And there are very few things worse (or more resourceful) than pissed engineers.
  3. If you don’t have to then PLEASE export the schematic in a vector format and then insert it into your text editor, graphics program or anything that applies.
  4. If you know of someone who does this, read this text to them. If they do not comply kick them in the naughty bits.

That’s it for my Bile giveaway – my angry rant section that will pop up randomly when something gets my bile up. And to finish this nice text here’s a photo of fluffy clouds:

So majestic...

So majestic…

Or perhaps it’s not clouds… just a fluffy schematic.

Bye bye,

 

David.

This entry was posted in Miscellany, Rant and tagged , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *