A new option has been added to the jpegtran tool and transcoding library:-scale M/N Scale output image by fraction M/N, eg, 1/8
Currently supported scale factors are M/N with all M from 1 to 16, where N is the source DCT size, which is 8 for baseline JPEG. If the /N part is omitted, then M specifies the DCT scaled size to be applied on the given input. For baseline JPEG this is equivalent to M/8 scaling, since the source DCT size for baseline JPEG is 8. CAUTION: An implementation of the JPEG SmartScale extension is required for this feature. SmartScale enabled JPEG is not yet widely implemented, so many decoders will be unable to view a SmartScale extended JPEG file at all.The new library is available for download in the following forms:
Windows binary compilation: jpegtran.exe or packed jpegtran.zip.
- official IJG JPEG 9 release version at www.ijg.org
- part of the Jpegcrop Windows source archive (~5 MB): jcropsrc.zip
- part of the initial Jpegcrop port to Unix archive (~3 MB): jpegcrop.tar.gz
Full binary packages (including cjpeg, djpeg, etc.): jpeg-bin
Lossless rotation is included in current versions of the IJG software.
An article about the jpegtran lossless transformation functions has been published in the German c't magazine 4/2005 (released 07-Feb-2005), title "Fotoschoner", page 188 ff. The article derives and describes the lossless transformation functions in a clear and understandable form.
My draft of the article (in German) is available here:
Verlustfreie_JPEG_Drehung.doc or Verlustfreie_JPEG_Drehung.pdf .
Note that the draft is quite different from the published version, but the essence is the same.
An Exif Patch has been added to the lossless transformation code to avoid some application problems.
Lossless cropping is included in current versions of the IJG software.Resources:
-crop WxH+X+Y Crop to a rectangular subarea -drop +X+Y filename Drop another imageSee my initial article in the IJG mailing list for important notes!