TranJPEG

Version 1.30


Contents

[ Introduction | Installation | Usage | The iconbar icon | Control window | Settings window | The status window | Screenshots | Contact | Changes ]

[ Licence ]

[ IJPG ReadMe document | IJPG Usage document ]


Introduction

TranJPEG is a WIMP front-end for the IJPG command-line utility 'jpegtran' and gives easy access to the features of the utility. It allows JPEG images to be transformed in a number of ways in a lossless process. See below for a list of the transformations currently supported by TranJPEG. The version of jpegtran currently supplied with TranJPEG is version 9.


Installation

For a new installation, simply drag and drop the TranJPEG application into the directory of your choice.

If you have a previous copy of TranJPEG you have two choices.


Usage

TranJPEG is run in the usual way by double clicking on its icon. It will install on the icon bar.

The file, or selection of files, to be transformed should be dragged to TranJPEG, either to the iconbar icon, when the control window will open, or if the control window is already open, files may be dragged to it.

The selection of files can be added to by dragging further selections. In addition, if one or more folders are dragged, then TranJPEG will add any JPEG files in the folder to the list.

TranJPEG will NOT recurse down the directory structure, only JPEG files in the top level will be added to the filelist.

TranJPEG uses a taskwindow to run the jpegtran binary, so the process essentially multitasks, and the machine remains usable during the batch processing.


The iconbar icon

If a selection of JPEG files is dragged to the iconbar icon, these files will be added to the list of files to be processed. The control window will open automatically if not already open.

Clicking with SELECT on the iconbar icon will open the control window.

The icon bar menu

Infoibarmenu.png
- 3026 bytes
Shows application information, including the version number, and also contains a Web button to check the download site for new versions.
Help...
Opens the html help file (this one).
Control...
Open the TranJPEG control window (see below). The control window can more easily be opened by clicking on the icon bar icon with Select.
Quit
Remove the application from the iconbar.

The control window

The control window is shown below.

conwin.png - 25Kb
Files to process
This shows the number of files waiting in the queue to be processed
Clear file list
Clicking this button allows the file list to be cleared if you change your mind about files in the list. It will clear the whole list.

The main part of the window controls the transformation actions that may be specified.

Optimise
If this is ticked then the entropy encoding parameters are optimised. If unticked, then default encoding parameters are used. Optimise usually makes the JPEG file a little smaller. Image quality is unaffected by optimising.
Progressive
If this is ticked then a progressive JPEG file is created. In this type of JPEG file, the data is stored in multiple scans of increasing quality. If the file is being transmitted over a slow communications link, the decoder can use the first scan to display a low-quality image very quickly, and can then improve the display with each subsequent scan. The final image is exactly equivalent to a standard JPEG file of the same quality setting, and the total file size is about the same.
Greyscale
This option discards the chrominance channels if the input image is YCbCr (ie, a standard color JPEG), resulting in a greyscale JPEG file. The luminance channel is preserved exactly, so this is a better method of reducing to greyscale than decompression, conversion, and recompression.
Transform
If this is ticked, then the image will be transformed in one of a number of ways. The particular transformation to be used is selected using the group of radio buttons below the transform button. The transformations that are available are described below.
AUTO rotate
This option relies on
  • The image file containing valid exif data
  • The camera writing an 'orientation flag' into the exif data. This is sometimes a user setting, rather than a default action

TranJPEG will attempt to read the orientation flag from the exif data, and if successful, will rotate the image according to the setting of this flag. Images with no exif data, a 'normal orientation' flag, or no orientation flag will be ignored.

Rotate right
Click SELECT to rotate each of the images 90° to the right.
Rotate 180°
Click SELECT to rotate each of the images through 180°.
Rotate left
Click SELECT to rotate each of the images 90° to the left.
Flip horizontal
Click SELECT to flip each of the images left to right.
Flip vertical
Click SELECT to flip each of the images top to bottom.
Transpose
Click SELECT to transpose each of the images (across the upper left to lower right axis). This can be thought of as a rotation to the right followed by a reflection (flip) left to right.
Transverse
Click SELECT to carry out the transverse operation on each of the images (across the upper right to lower left axis). This can be thought of as a rotation to the left followed by a reflection (flip) left to right.
Smartscale
This results in a 'lossless' scaling. There are a limited range of options, which can be chosen using the menu button to the right. The scales available are
  • Scale up by a factor of 2
  • Reduce image size to one half
  • Reduce image size to one quarter
  • Reduce image size to one eighth
Currently there are not many RISC OS applications that understand and can display a smartscaled image.

Destination of transformed file

Below the transformation buttons there is a means of specifying the destination of the transformed files.

Use save path

If Use save path is NOT ticked then TranJPEG will put the transformed image into a directory (in the same location as the original image) named for the transformation, e.g. 'rotleft'. This is to prevent TranJPEG overwriting the original image.

If Use save path is ticked then it is possible to specify the directory in which the transformed images are to be placed. This directory can be set in two ways.

Settings

At the foot of the window is a button Settings..., which will open a further window allowing further options to be set. This is described in the next section.

Starting the processing

At the bottom right of the control window is the Process button. Clicking SELECT on this will start the batch process off. Assuming there are some JPEG files in the queue, the control window will close, and the status window will open. This is shown below.


The settings window

Clicking 'Settings' in the control window will open a new dialogue and reveal more options.

Trim non-transformable edge blocks
The following is taken from the Independent JPEG Group's documentation for jpegtran

The transpose transformation has no restrictions regarding image dimensions. The other transformations operate rather oddly if the image dimensions are not a multiple of the iMCU size (usually 8 or 16 pixels), because they can only transform complete blocks of DCT coefficient data in the desired way.

jpegtran's default behavior when transforming an odd-size image is designed to preserve exact reversibility and mathematical consistency of the transformation set. As stated, transpose is able to flip the entire image area. Horizontal mirroring leaves any partial iMCU column at the right edge untouched, but is able to flip all rows of the image. Similarly, vertical mirroring leaves any partial iMCU row at the bottom edge untouched, but is able to flip all columns. The other transforms can be built up as sequences of transpose and flip operations; for consistency, their actions on edge pixels are defined to be the same as the end result of the corresponding transpose-and-flip sequence.

For practical use, you may prefer to discard any untransformable edge pixels rather than having a strange-looking strip along the right and/or bottom edges of a transformed image.

Copying exif data
The three radio buttons control what jpegtran does with any exif data in the image file. You can choose to copy everything into the transformed image, only the exif comments, or nothing at all.

Neither TranJPEG nor jpegtran will modify the exif data in any other way. This means, for example, that the orientation data will remain the same. If the rotated image is then viewed in software that uses the orientation data, then it may rotate the image again (but see below under 'Write back orientation'). The thumbnail, if present, will still show the image in its original orientation.

Copy non-transformed images
If this is not ticked, then during auto-rotation with a save path set, only those images which actually require rotation will end up in the new location. If this option is ticked, then non-rotated images will be copied unchanged into the new location, so that a complete set of images will be produced.
Write back orientation
The auto-rotate option uses the orientation data in the exif header to return the image to a 'normal' orientation. However, any software that uses this orientation data to auto-rotate the image, e.g. for display, or even TranJPEG itself, will still rotate the image. If you write back the orientation as 'normal' then the image will not be rotated again. This write back will only work if all the exif data has been copied into the newly transformed image, although if the exif data has not been copied, then auto-rotation would not work anyway.

The status window

When the Process button is clicked, assuming there are some JPEG files in the queue, the control window will close, and the status window will open. This is shown below.

There are four display fields which show the progress of the processing. The total number of files to process, and the position in the queue of the current file are shown. The filename of the current file is also shown. There is also a field that shows the current operation being carried out.

The two buttons at the bottom allow some control over the taskwindow processing.

Pause
This will allow the current transformation to be paused. The button text will change to Resume, and clicking on it again will result in the transformation being continued.
Stop
This will immediately terminate the current transformation. The transformed image file may be left in a partially processed state and should be deleted.

If there are more images waiting in the queue to be processed, TranJPEG will ask whether it should continue to process these remaining images, or abandon the whole process.


Screenshots

All the screen shots in these pages were obtained using Snapper, a versatile screen capture application.

Snapper is available from http://www.chris-johnson.org.uk/software/snap.html


Contact

All communication about TranJPEG should be directed to Chris Johnson (Email:chris@chris-johnson.org.uk). Suggestions for new features are always welcome.

Web sites

Chris Johnson's web site is at http://www.chris-johnson.org.uk/index.html, with his RISC OS software at http://www.chris-johnson.org.uk/software/index.html.


This document last modified on 5 Sept 2013

The TranJPEG front-end is © Chris Johnson, 2013