Documentation Archive Developer
Search

ADC Home > Reference Library > Technical Q&As > QuickTime > Compression & Decompression >

spatialQuality Values with Lossy Compression


Q: When working with JPEG images, I noticed the spatialQuality field of the ImageDescription record retrieved by GraphicsImportGetImageDescription is always set to codecNormalQuality, even when GraphicsExportSetCompressionQuality specified codecHighQuality as the CodecQ value for an export operation.

How does the spatialQuality value reflect the setting of lossy compressed images like JPEG?

A: The properties which really determine the quality of a JPEG file are the quantization tables and chroma subsampling factors (altogether totaling over a hundred numbers) used during encoding.

QuickTime's JPEG compressor chooses values for these based on a spatialQuality setting during encode, but there are plenty of q-tables and subsampling factors that don't correspond to a specific spatialQuality setting. Additionally, third-party JPEG encoders may choose wildly different q-tables. Because of this, on import, any spatialQuality value QuickTime came up with wouldn't be an accurate representation of the actual quality of the image.

The only accurate piece of information conveyed by the Image Description's spatialQuality setting is that lossy compression was used. If the compression was lossless, the Graphics Importer should report this by setting the spatialQuality value to codecLosslessQuality.


[Mar 12 2002]