Recommended compression quality for JPEGs

  • Last Post 20 January 2013
miracle2k posted this 20 January 2013

Is there any information on how to choose a compression quality for images uploaded. Obviously transmission size is an issue here, but at the same time, you wouldn't want to compromise on quality.

In my tests, I find it hard to see a measurable difference in OCR results, even between 10% quality and 100%. The results are different, at times (in terms of which blocks it interprets as text, and parts that result in gibberish in either case), and lower quality seems to cause more desperate (and futile) attempts to decode certain hard to decipher elements - but no actual mistake are made.

Is there a more definite answer from the professionals out there?

  • Liked by
  • Dmitry Me
Andrey Isaev posted this 20 January 2013

I would answer that there is no general recommendation since optimal compression will depend on:

  • actual compression algorithm you are using (not all algorithms understand "quality" the same way, so different implementation will give different result for the same parameter)
  • DPI of the image or number of pixels per character. If this number is low, then it is recommended to stick closer to 100% end of scale, otherwise it may damage letter shapes. If there are hundreds of pixels per character then it is optimal to use higher compression, since it will not only reduce file size (and as result, network transmit time), but also will filter out all unnecessary details and make recognition faster and sometimes more accurate.

Basically, you should find out optimal "quality" by experimenting with most typical images you are going to recognize. And of course, using same compression library you will use later in production. That means, if you are doing both iPhone and Android applications, you should do two sets of experiments, and in no case rely on the same experiment done from the desktop.

  • Liked by
  • Dmitry Me