Skip to main content
Question

Writing JPEG with defined compression


Forum|alt.badge.img

I am going to use FME to run finalisation on ortophoto projects. Two of the products require JPEG to be part of final delivery. One require compression Q= 10, the other Q= 20.

Producing the files is fast enough, and images look good when viewing in IrfanView. But when reading the header-info in "ISRU Display Header", I realise that the actual compression deviates from the set compression value in the Writer. I cannot deliver this to client, as they will simply not accept non-compliance of the specs given (when they say Q= 10, they mean it).

Does anyone have experience in similar issues, and able to give me a hand?

5 replies

davideagle
Contributor
Forum|alt.badge.img+21
  • Contributor
  • January 11, 2016

I've just tested this and setting compression to 10 in FME yields a value of 91 in IrfanView...

20 in FME = 82 in IV

85 in FME = 24 in IV

So, I think I've replicated what you are seeing and it is a little odd. Does this tally with what you get?

Either Irfanview is reporting the compression with a rounding/incorrectly or FME is applying the compression incorrectly. Do you have another photo package that you can use to check the compression in also? I don't I'm afraid.


Forum|alt.badge.img

Running Q= 10 in FME give me "JPEG, quality: 91, subsampling ON (2x2)" in IrfanView, whilst ISRU Display Header state: "JPEG Compressed 24 bit RGB data, Q= 9".

There are interpretations of "Q". Either how much the file has been reduced by (ISRU, FME), or what's the resulting filesize as compared to original (IrfanView).


Forum|alt.badge.img

As you can see @spatialdave1, the core issue is that setting Q is unreliable. In the example above, I need Q= 10, but get Q= 9. Other images may return slightly different values as well.

When delivering according to customer specifications, I need FME to give me what I ask. Could I have a choice if I need to enforce my settings, contra having FME dynamically set it's best output?


daveatsafe
Safer
Forum|alt.badge.img+19
  • Safer
  • January 12, 2016

There is some good information on photo.stackexchange.com about this issue: http://photo.stackexchange.com/questions/30243/wha...

The short answer seems to be that the compression setting is target for how much information the lossy part of the JPEG algorithm can discard. The actual compression depends on the amount of detail in the image itself. A low detail image will compress more than a high detail image.

JPEG files do not store the compression quality used to create the file, so the quality reported by IrfanView or ISRU would only be an estimate.


sigtill
Supporter
Forum|alt.badge.img+24
  • Supporter
  • January 14, 2016

A chart showing Irfanviews "compression levels" http://www.impulseadventure.com/photo/jpeg-compression.html


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings