Photo Studio

User Documentation



What is Photo Studio?

Photo Studio is a utility for viewing/processing JPEG images, providing a number of useful functions all in one convenient package. It was written with digital camera users in mind, although it does not require a digital camera either to operate or to be useful.

Is Photo Studio a paint package?

No! It can perform some basic image editing tasks (transforming and scaling), but is not intended as another paint package, there are already some very good ones of these available! Instead it is intended to provide some useful functions that paint packages don't, or at least don't do in the best posible way.

What is JPEG?

JPEG stands for Joint Photographic Experts Group and is a standard (or indeed set of standards) for compressing images, particularly well suited to continuous tone images such as photographs. The JPEG file format is arguably the most commonly used for photographic images.

What are marker sections?

JPEG files are constructed of a number of segments, generally referred to as marker sections. At the start of the file, the JPEG standard allows for any number of these sections to be written containing free format application specific data. Many applications ignore the contents of these marker sections and just read/write the main image. JPEG images, particularly those coming from a digital camera originally, can often contain very useful and interesting information in these sections, which would just be discarded by most programs that handle these files. Two principle standards have emerged which give guidelines for the format of some of these marker sections and how/what information should be included in them. These are JFIF and EXIF. Photo Studio specialises in the viewing and manipulation of information held in these formats.

What are thumbnails?

A thumbnail is just a small version of an image, intended to allow quick previewing, especially where we wish to search through many images at the same time. In Photo Studio, thumbnails are split into two categories, inline and external. Quite simply, an inline thumbnail is stored in the same file as the image it represents, whereas an external thumbnail is in a file by itself. Thumbnails can be stored either as bitmaps or as JPEG images.

What is JFIF?

JFIF stands for JPEG File Interchange Format. It is a specification to enhance interchangability of JPEG image files between different applications by providing additional image informtion in one or more marker sections of a JPEG file. The amount of additional information stored by JFIF is quite small, however, JFIF does also allow for inline thumbnails to be stored in the marker sections of a JPEG file. Currently (JFIF v1.2) there are two types of JFIF marker section. The first, referred to here as the JFIF main section, contains the image density and an optional bitmap thumbnail. The second, referred to here as a JFIF extension section, contains a thumbnail either as a bitmap (24 bit or 8 pit with 256 colour palette) or as a JPEG image.

What is EXIF?

EXIF stands for Extended Interchange Format. It was designed specifically with digital cameras in mind, and is based on the TIFF (Tagged Image File Format) specification. It allows for a large amount of information to be stored about the image in the marker sections, describing the camera which took the image along with the settings (including date/time) in use when the picture was taken. Also, as with JFIF, it allows for an inline thumbnail to be included, and supports both JPEG and bitmap thumbnails.

What else is stored the marker sections?

One other important type of marker section found within JPEG files is the comment section. This does exactly what it says on the tin - allows a comment to be given for the image stored. There are other miscellaneous types of marker section not yet fully supported by Photo Studio, however, even in an unknown marker section, Photo Studio may still be able to find an inline thumbnail.


Photo Studio is implemented as a familiar Windows style multiple document environment, allowing more than one file to be viewed/edited at the same time. Each file will occupy its own window in the usual way.

Additionally, Photo Studio provides a browse window allowing thumbnails of a whole directory to be viewed at one time, and "batch" operations to be performed on ranges of images.

The Browse Window

The browse window allows thumbnails of a whole directory of JPEG images to be viewed at the same time. It is fully dockable, and so can be placed at the left, right, top or bottom of the main window as the user wishes, or instead can float independantly. Each JPEG image in the directory being viewed is represented by a rectangle. Where an inline thumbnail exists within this image, this will be displayed to represent the image. Where no inline thumbnail exists, an empty rectangle will be displayed. See Thumbnail Operations for how to create these inline thumbnails. Red dots in an image rectangle show it has been edited in some way.

Pop-up Menu

Right clicking on an image in the browse window pops up a menu that functions in exactly the same way as the Browse menu in the main menu bar.

Choosing a Directory to Browse

This can be achieved in a number of ways.
  1. From the Browse menu, select Choose Directory.... A standard Windows directory dialog appears, in which you can then choose a directory to browse.
  2. Press the browse button located in the bottom right hand corner of the browse window. This produces the same dialog as above.
  3. Alternatively, if the directory you wish to browse is already known, simply type the path into the edit box at the bottom of the browse window, then press enter (or the tab key).

Selecting Images

Ranges of images can be selected in the browse window in the normal way. A click selects a single image. A click with the shift key held down allows a continuous range of images to be selected. A click with the control key held down allows discontinuous ranges to be collected. Additionally, the Browse menu provides options to select all, none or invert the current selection of images.


To sort the images in the browse window, select Sort... from the Browse menu. A dialog will then appear giving a number of choices for how to sort the images. As a default the images will be sorted in directory order - the order in which images were created in the directory.

Saving Changes

Certain operations can be performed that will make changes to files in the image browser. These changes will cause a red dot to appear in the image's rectangle. Such changes will not be applied to the file until Save Changes is selected from the Browse menu. Note that unless an image is scaled, its file can be loaded and saved as many times as you wish without any loss in image quality - the image will only be recompressed for a scale operation.

Viewing/Editing Individual Images

As you might expect, images can also be loaded in their own separate window allowing you to view the main image in full, in addition to the thumbnail (where present) along with a selection of other information about the image.

Loading Individual Images

This can be achieved in one of several ways:
  • From the File menu choose Open..., then choose the image you require from the standard file requester.
  • From the browse window, double click on the thumbnail you wish to load.
  • From the browse window, select one or more images, then choose Open Selected... from the Browse menu.

Saving Individual Images

This can be achieved with Save or Save As from the File menu in the normal way. Note that unless the image is scaled, the file can be loaded and saved as many times as you wish without any loss in image quality - the image will only be recompressed for a scale operation.

The Image Window

The view for an individual image includes a tab control that allows the user to select which aspect of the image to view.
Displays the main image.
General Info
Displays general information about the image.
Allows the user to view/edit the comment to be saved along with the image. If nothing is entered here, no comment section will be saved with the file.
Displays the raw data (in hex) of the marker sections in the header of this JPEG file, if any are present. A second tab control is displayed, and each tab relates to a single marker section.
Displays the inline thumbnail, if present.
JFIF info
If this image contains a JFIF marker section, the information contained therein will be displayed here. Note the fields "Thumbnail Width" and "Thumbnail Height" refer only to thumbnails stored in the main JFIF marker section, not those stored in a JFIF extension section
EXIF info
If the image contains an EXIF marker section, the information contained therein will be displayed here. The EXIF information is essentially a TIFF file. TIFF files are split up into a number of sections called Image File Directories (IFDs). A second tab control is displayed for EXIF information, and each tab represents either an IFD or a section of data (e.g. the thumbnail's data). For simple data sections, just the raw data is displayed (in hex). For an IFD, a list of the values within that IFD is displayed. These values are fully interpreted wherever possible. The IFDs likely to be found in a normal EXIF file are as follows:
Contains general information about the main image.
Contains extended information about the main image.
EXIF Interoperability IFD
Contains information to support interoperability between different EXIF implementations.
Maker Note IFD
Contains information specific to the manufacturer of the camera, written in IFD format. Note that a maker note may not always be in IFD format, in which case the raw data will be displayed instead.
Contains information about the thumbnail image.
Photoshop info
Some images saved by Adobe Photoshop have additional information stored in APP13, including possibly a thumbnail, and this information will be displayed here. The section is split into a number of resource blocks, each with its own name and data.

Transforming Images

Most commonly, especially when processing digital camera images, we will simply want to do rotation. Photo Studio, in fact, supports seven transformations in total - rotating by 90,180 or 270 degrees (clockwise), flipping horizontally or vertically, as well as transposing and transvering. Obviously, anti-clockwise rotations are just clockwise transformations with different degrees: 90 degrees anti-clockwise is the same as 270 degrees clockwise and so on.

Photo Studio supports lossless transformations, thanks to code from the Independant JPEG Group. Conventionally, JPEG images would be transformed by first decompressing them, then performing the transformation, then recompressing the transformed image. Given that JPEG is a lossy compression method, some image quality is potentially lost in this process. Where it can, Photo Studio will transform JPEG images without decompressing them.

One slight drawback of performing lossless image transformations is that partial blocks cannot be transformed. JPEG images are made up of blocks, normally 8x8 (or sometimes 16x16). Where an image's dimensions don't fit exactly into these block sizes, we will be left with partial blocks on one edge. The lossless transformation routines will not transform these, so some images may be left with an untidy edge. Thankfully, dimensions of digital camera sourced images are normally a multiple of 8 or 16 (e.g. 640x480), and so normally this should not happen. TO DO: A future version of Photo Studio will provide options to trim these edges or perform transformations in the usual (lossy) manner where these edges would occur.

One advantage of using Photo Studio over (say) a conventional paint program, is that it will transform inline thumbnails at the same time as the main image. Both JPEG and bitmap thumbnails can be transformed in this way. Of course, where an inline thumbnail is stored as a bitmap, it can be transformed without any of the above difficulties. Note that only JFIF or EXIF inline thumbnails can be transformed. Thumbnails found in marker sections of an unknown format will not be transformed as we may in the process damage the integrity of the section.

Additionally Photo Studio allows you to perform several transfomations in sequence, and will calculate the equivalent transformation as it goes along. As such when you eventually save the changes (be it from the browse window or for an individually loaded image) the transformation will be performed in a single pass.

From the Browse Window

Select a range of images you wish to transform in the normal way. Then from the Transform sub-menu in the Browse menu, either choose the name of the transformation, or choose Select..., which will produce a dialog allowing you to choose a transformation graphically. The thumbnail should then be transformed as requested, and a red dot will appear on the image to signify it has been modified. The transformation will not actually be applied to the file until Save Changes is chosen from the Browse menu. Before saving, one or more transformations can be undone, using the Revert option in the Thumbnail menu.

For Individual Images

For an image loaded in its own window, simply choose the transformation you require from the Image/Transform menu, or Select... from the same menu. As before, the transformation will not be applied to the file until the image is saved.

Scaling Images

Unlike transformation, scaling cannot be performed losslessly - we will always need to decompress the image, scale it, then recompress it. However, Photo Studio is still useful in this capacity as it will not discard the image's marker sections as some paint packages may. Photo Studio performs scaling using a bilinear filter so should always produce fairly smooth results.

From the Browse Window

Not yet implemented.

For Individual Images

The Image/Scale menu provides options for scaling the current image. Only the main image will be scaled - any inline thumbnails will be left unaffected. Three common scale options are given in this menu (200%, 50% and 25%). Much greater flexibility can be achieved with the Select Scale... option. This displays a dialog allowing scale parameters to be set. The different scaling modes available are described below.

Scaling Modes

Exact dimensions
This allows the exact output dimensions (in pixels) to be specified regardless of the original size. Note that the aspect ratio will not necessarily be maintained.
Percent of original
This allows the output dimensions to be specified in proportion to the original size. The first field gives a percentage of the original width and the second a percentage of the original height. These fields should be equal if the aspect ratio is to be maintained.
Frame dimensions
This is useful where we have a number of images with differing aspect ratios (for example, some portrait and some landscape), which we want to fit into same-sized frames. There are several different frame modes but for normal use "Best fit" is probably the only one we need look at. The dimensions given specify the dimensions of a frame, and the image will be scaled to fit into this frame, but without losing the aspect ratio. So for example, we might want to fit a 120x160 image into a 160x120 frame. The image will be scaled to 90x120 - the aspect ratio is still 3:4 but neither of its dimensions exceed those of the frame given.
Padded frame dimensions
Not yet implemented. When working, this will operate in a similar manner to the above, except that the output image dimensions will always be exctly that of the frame - solid blocks may be inserted to maintain the aspect ratio.

Filter Modes

This is a simple straightforward filter which is good for regular scaling operations, particularly when the size is being reduced - so for example when scaling from 640x480 down to 160x120 - we are reducing exactly by 4 in each direction, so a box filter will give good results.
This is a slightly more complicated filter which will attempt to perform slight blurring between hard edges, to reduce the pixelation often incurred by scaling. It is therefore better for when scaling up, or when scaling by an irregular amount - for example 640x480 to 1000x700.

Thumbnail Operations

From the Browse Window

Select a range of images you wish to apply the appropriate thumbnail operation to, in the normal way. Then from the Thumbnail sub-menu in the Browse menu, choose the required thumbnail operation. You will be presented with a dialog in which you should set the appropriate parameters (see below for more information). Operations which modify the files selected (Create Inline and Insert Inline) will not actually be applied to the files until Save Changes is chosen from the Browse menu. With Create External and Extract Inline, the external files will be written immediately.

For Individual Images

For an image loaded in its own window, simply choose the thumbnail operation you require from the Image/Thumbnail menu, and then select the appropriate parameters in the dialog which follows. As before, with Create Inline and Insert Inline, the changes will not be applied to the file until it is saved.

Create External

This is prinicpally intended for when creating web pages. A scaled version of the main image will be saved as a separate JPEG file. Upon selecting this option, you will be presented with a dialog with two property pages as follows:
File names
Describes how the thumbnail file name(s) will be calculated from the source file name(s).
Describes how the thumbnail image will be scaled from the main image. See the Scaling Images section for more details.

Extract Inline

As an alternaitve to the above, where an inline thumbnail already exists, we can of course create an external thumbnail simply by extracting the inline thumbnail's data from the appropriate marker section and saving it to a file. TO DO: Currently if the inline thumbnail is JPEG, the program will actually decompress and recompress it before saving it as a separate file - it should really just save the data directly.

Upon selecting this option, you will be presented with a dialog with two property pages as follows:

File names
Describes how the thumbnail file name(s) will be calculated from the source file name(s). Note if the thumbnail is to be saved as a bitmap the extension should be changed to ".bmp" rather than the default ".jpg".
Thumbnail Types
In the event that the source file(s) contain more than one type of thumbnail this allows the type to be chosen. The default is "Any". The Format option allows the ouput format to be specified. This can either be a 24-bit bitmap or a JPEG file. The program will happily save inline bitmap thumbnails as exteranl JPEG files and vice versa.

Create Inline

For images not already in posession of an inline thumbnail, or where we want to overwrite the existing thumbnail, or even where we want to add a second thumbnail, this option is provided. A scaled version of the main image will be encoded in the marker section specified with the given format (bitmap or JPEG). Upon selecting this option, you will be presented with a dialog with two property pages as follows:
Describes how the thumbnail image will be scaled from the main image. See the Scaling Images section for more details.
Thumbnail Types
Selects the format (bitmap or JPEG) and type of marker section in which to create the thumbnail.

Insert Inline

As an alternative to the above, where an external thumbnail for this image already exists, you can insert this as an inline thumbnail. TO DO: This function has not been tested much, so might not work under all possible circumstances. Whereas inserting JPEG thumbnails should work fine, inserting bitmap thumbnails probably doesn't.

Upon selecting this option, you will be presented with a dialog with two property pages as follows:

File names
Describes how the thumbnail file name(s) will be calculated from the selected file name(s). Note if the inserted thumbnails are bitmaps the extension should be changed to ".bmp" rather than the default ".jpg".
Thumbnail Types
Selects the format (bitmap or JPEG) and type of marker section in which to insert the thumbnail.

Creating HTML index pages

One common task required by digital camera users (or indeed other users handling JPEG images) is to create HTML index pages for their images, either to upload to the web or to organise files locally. Photo Studio facilitates this with re-usable template files that provide flexibility in the formatting of these pages. It also allows for captions to be created for each image taking information from a number of sources within the image files - the comment section, EXIF fields (e.g. date/time) and so on.

Index Template Files

An index template file can be created by selecting New from the File menu. In the dialog that appears, select "Index Template", and click OK. A new index template window should be created. This displays a preview of what the index will look like. (TO DO: this is currently quite basic, and just shows empty rectangles where the thumbnail images will appear).

The various settings for this template can be edited by either double clicking anywhere in the template's window, or by selecting Properties... from the Template menu. This then produces a dialog with two property pages.

Index Format
Here the user can define the overall layout of the index page.
The number of columns to display across the page. Each column will contain thumbnail images and their corresponding captions.
Caption Positioning
Describes whether or not a caption will be used and how it will be positioned in relation to the thumbnail. If this value is "None" no caption will be used.
Cell vertical alignment
The vertical alignment of each cell within the row it resides.
Cell horizontal alignment
The horizontal alignment of each cell within the column it resides.
Fit table to page width
If checked, the column widths will be expanded to fit the whole page. Otherwise they just take as much space as they require.
Place caption in separate cell
If checked captions and their corresponding images will have a separate cell each. Otherwise they will be placed in the same cell.
Here the user can decide what information will be included in the captions with each image, if these are to be used. The caption may be constructed from a number of components. The types of components are listed below:
The contents of the JPEG comments section.
File name
The name of the file.
File date/time
The file's date and time. This requires a format specification familiar to anyone who has used time formatting functions in any ANSI-C or similar language. For example, %H:%M:%S %d/%m/%Y, will give the complete date and time in full.
File size
The size of the file, in bytes.
File type
Exif, Adobe, Jfif or just plain Jpeg.
Image width
The main image's width.
Image height
The main image's height.
EXIF date/time
As file date/time, but uses the inline EXIF date/time.
EXIF value
An EXIF value from a given IFD, with a given name. Not all images contain all fields, so you should have a look at your images first to check they contain the fields you require, and to find which IFD they appear in - see the Viewing/Editing Individual Images section. Usually images from the same camera will contain the same fields.

The components box allows the user to select a single, list or range of components. Ranges are specified with dashes (e.g. 3-10), and single components (or indeed further ranges) can be separated by commas (e.g. 1,5 or 4,7-12,15 etc). As an example, with a date/time field, we might choose just components 12-20 to get the time but not the date.

EXIF value meaning
As above, but the meaning rather than the value itself.
A piece of text. May be an HTML tag.

Once the index template has been edited, it should be saved by selecting Save or Save As... from the File menu.

Creating an Index

In the browse window, select a range of images for which you wish to create an index in the usual way. You may wish to sort these first - see the Browse Window section for more information. You will probably want to sort these in name or date/time order. The default directory order may sometimes place files in an unusual way. From the Browse menu select Create Index.... You will then be presented with a dialog containing three property pages.
This allows the user to select various parameters specific to this index file - the file name, the template to be used and so on. The default file name is "index.html". The file will be created in the same directory as the images for which it is being created - i.e. the current directory being viewed in the browse window. The template file name must be given. If you do not supply the name of a valid template file, an error message will be displayed and no index file will be created.

The "Thumbs path" field gives the path of the thumbnail files that will be written in the HTML file - which may differ from their physical path on the current disk. This is partly because URLs use forward slashes rather than the backslashes used in Windows (although Windows seems to accept both), but also because the directory your pictures will reside in on the web (say will obviously be different from the directory they reside in on your hard drive (say C:\Web\).

This currently doesn't work - the images should be sorted in the required order in the browse window first.
File names
Describes how to locate the external thumbnails on your hard drive. This is done in the same way as with the previous thumbnail operations: you should specify a path where the thumbnails reside, along with a mask giving how to calculate the thumbnail's filename from the main image filename.

We need the names of these thumbnails to insert into the HTML file. Their path on the local drive is required so they can be examined during the creation of the index to extract their dimensions. As noted above, the path used on the web for the thumbnails may be different to that used on the local drive. The path given on this property page will not be inserted into the HTML file - that path will instead be taken from the index property page.

The Comment Editor

Creating Mosaics

Downloading Images


Photo Studio was written by John Hawkins.
It is based in part on the work of the Independant JPEG Group.
Thanks to TsuroZoh Tachibanaya for lots of useful information on the EXIF file format.