The image format for thumbnails is the PNG format, regardless in which format the original image was saved. To be more specific it must be a 8bit, non-interlaced PNG image with full alpha transparency (means 255 possible alpha values). However, every program should use the best possible quality when scaling the image. The exact meaning of this is left to the specific program but it should consider applying antialising to the thumbnail.
The thumbnail name is concatenated from the original image name (including the suffix) and the .png suffix. So the thumbnail name for portrait.jpeg would be portrait.jpeg.png. For my_car.png it would be my_car.png.png.
One drawback of this approach occurs if the filename length of the original image is larger than the systems MAX_FILENAME_LENGTH-4, because the 4 characters long '.png' suffix will be appended. This is a known problem, but is considered as not critical since for 99.99% of all cases this limit won't be hit (at least on Unix systems where the maximum filename length normaly is 256 characters). However, if such a case occures the thumbnail can not stored permanently.
Beside the storage of the raw graphic data its often useful to provide further information about an image in its thumbnail. Especially file size, image dimension or image type are often used in graphic programs. If the thumbnail provides such information it avoids any need to access the original image and thus makes the loading faster.
The PNG format provides a mechanism to store arbitrary text strings together with the image. It uses a simple key/value scheme, where some keys are already predefined like Title, Author and so on (see section 4.2.7 of the PNG standard). This mechanism is used to store additional information.
The following keys and their appropriate values must be provided by every program which support this standard:
Table 1. Required PNG keys.
| Key | Description |
|---|---|
| OriginalWidth | The width of the original image. |
| OriginalHeight | The height of the original image. |
| OriginalSize | Size in bytes of the original image. |
| OriginalMTime | The modification time of the original image. |
| Software | This key is predefined by the PNG standard. It stores the name of the program which generated the thumbnail. |
There are surely some situations where further information are desired. Eg. the Gimp could save the number of layers an image has or something like this. So if an application wants to save more information it is free to do so. It should use a key in its own namespace (to avoid clashes) prefixed by X- to indicate that this is an extension. The namespace is just the application name, so that eg. Gimp could save the layer info in the key X-GIMP::Layers.
With this approach a program doesn't have the guarantee that these keys are stored in the thumbnail. They may be created by another program which only provides the required ones. There hasn't been a general solution to this yet and I don't think there is.