T2 SDE
SANE/Avision
ExactAudio
ExactImage
   Econvert
   Edisplay
   Edentify
   Hocr2PDF
   Utilities
   Image formats
   API
   Lossless JPEG
   Bardecode
   Releases
   Roadmap
   Feedback
EmbeddedSTL
eScreen
MacOSD
minised
ExactBuild
Openbench
Vorbisinfo

Introduction to lossless JPEG

The JPEG format is based on the Discrete Cosine Transform (DCT) performed on equally sized blocks of the pixel image data. With this in mind one can conclude that it is possible to perform some transformations on the image data directly on these DCT coefficients by just moving and transforming the coefficients.

 

As just working on the DCT coefficients is less expensive (in terms of CPU cycles) as the decoding and re-encoding process is skipped, it saving a lot time and additionally prevents new compression artefacts.

 

Lossless JPEG transformations where first implemented in the Open Source jpegtran program - a companion application of the JPEG library, but as using a different tool or library for every image format is a bit unhandy. Support for these transformations based on the jpegtran code was added to ExactImage version 0.3.0.

 

ExactImage 0.3.0 supports lossless:

  • orthogonal rotations (90, 180, 270 degree)
  • flipping the image data on the X and Y axis

ExactImage 0.3.1 further introduced:

  • fast color image to gray conversion
  • fast down-scaling by partial decoding DCT coefficients

ExactImage 0.4.1 further introduced:

  • cropping

Common with all this operations is that they are way faster than performing the pixel-level algorithm on the decoded image data and (aside down-scaling) do not introduce new artefacts.

 

Fast down-scaling is also implemented by Enlightenment's EPEG library explicitly and we should mention that EPEG is slightly faster, but with cost to image quality - mostly because it does just nearest neighbor scaling of the residual scaling applied on top of the partial DCT decoding:

 

(A trick how to get a few percent faster down-scaling is outlined in the econvert Tips & Tricks section.)

 

ExactImage fast JPEG scaling and EPEG compared:

 

ExacImage

 

 

Enlightment's EPEG

 

The photo of a Psion Revo PDA running T2 Linux shows how whole pixels can get lost. The dash (-) in the middle of the screen is missing in the EPEG version.

 

 

 

 

This is a shot of the T2 CeBIT booth in 2005 the text on the T2 overview poster is badly mangled in the EPEG version. Also note the uneveness of the iBook display.

 

 

 

 

A real world photo of a Formula One car. Notice how overall noisy and jaggedly the EPEG output becomes.

 

 

 

 

And finally for the fun of it, a shot of a freshly renovated VW beetle engine inside a Maplex buggy. All the round elements are distorted:

 

 

 

 


ImpressumAGB