If image sizes are multiple of MCU (macroblock in videocodecs), typically 16x8 (because of downsampling, but can be 16x16 or 8x8), it is trival to replace or parts of image with those boundaries without any quality loss to image.
Utilising more of this makes possible to have different quality settings in different parts of image.
Two new options are introduced:
jpegtran -appright legend.jpg img_1234.jpg > legend_1234.jpg jpegtran -appbottom caption.jpg img_1234.jpg > caption_1234.jpg
Error checking is minimal, so result is undefined if image dimensions (height in case of append to right and width in bottom case) do not match. Also images must have same subsampling and same number of components.
One way to check image parameters is run djpeg with option -v to check image properties.
djpeg -v img_1234.jpg > /dev/null
This program may destroy your images. Be warned.
This patch is build on version shipped with Ubuntu Lucid (7+really6b-15ubuntu1).
Modification is provided for free use, no copyright is kept (other than required for law).
Markus Peuhkuri email@example.com