Pentax Image File Formats


Welcome to my repository for the information that I have gleaned about the format and layout of image files created by Pentax DSLR cameras.


Pentax DSLRs are capable of creating and storing images in several different formats. By far the most common format is a JPEG file. These conform to the TIFF/EP specifications. Most significant, for our purposes, is that this means that in addition to the actual image data they also contain a couple of sections of information (organized as ImageFile Directories, or IFDs); a Primary IFD containing details of the camera make & model, etc., and an EXIF IFD (pointed to by the primary IFD) containing exposure details and the like.

The other commonly-seen file format is a RAW file. The first commercially available Pentax DSLR, the *ist D, was also capable of creating RGB TIFF files, but this capability was dropped from later models. For the first three years all RAW files were in a proprietary TIFF/EP format, identifed by a PEF file type, but with the introduction of the K10D in late 2006 Pentax began supporting the Adobe Digital Negative format (or DNG).

The overall layout of all these files (PEF, DNG, or the TIFFs from the *ist D) is very similar. The primary IFD describes the main, full resolution, image. There are also a couple of secondary IFDs; one for a 160x120 thumbnail JPEG image, and one for a full-resolution (but highly compressed) JPEG image. These secondary images are presumably intended for use by image browsers, including the on-camera image review. There is also an EXIF IFD.

In addition to this information Pentax image files contain some Pentax-specific information. This is stored in the MakerNote tag (pointed to by the EXIF IFD) in JPEGs, TIFFs and PEFs. In a DNG (either one created directly in-camera, or one created by version 3.1 or later of the Adobe DNG Converter from a PEF) this data can instead be found in a DNGPrivateData tag.

Like many other camera manufacturers (including Nikon, Canon and Casio) Pentax have chosen to use a variant of a TIFF/EP IFD to store their private data. The first part of a MakerNote (or DNGPrivateData) tag is, after an identification string, simply an IFD, although the tag type values are manufacturer-specific, rather than standard TIFF/EP tag type codes. (I have heard that Pentax and Casio share tag definitions, but I have not confirmed this).

The Pentax tag codes seem to fall into three distinct groups. The first group (tag codes 0-511) is used for simple numeric values of at most four bytes. The next group (tag codes 512-1023) is for short arrays, many of just four values, while the final group (tag codes 1024 and above) is used for long arrays.


Pentax Private Tag Types

The following table shows which tags are present in the various different kinds of images. A "-" in a column means the tag does not occur in this file type; a "Y" means it is present; a "*" means the tag may or may not be present (see the notes following the table).

The first three columns show the tags present in files from the *ist D (JPEG, PEF and TIFF).

The next two columns are for JPEG & PEF files from the later *ist Dx models (DS/DL/DS2/DL2). Then are two columns reserved for the K100/K110, and finally three columns for files from the K10D (JPEG, PEF and DNG).

The data I have for the *ist Dx models comes from very early example files from a DS and a DL; I don't know if the later models (or later firmware revisions) made any changes to the tags.

I have not yet examined files from the K100D or K110D, so I don't know if they differ enough from the *ist Dx models to warrant a separate entry in the table.

TagDescription Found In
D Dx Kx K10D
J P T J P J P J P D
0PentaxVersion -- -- Y Y
1PentaxMode YY YY Y Y
2PreviewImageSize YY YY Y Y
3PreviewImageLength YY YY Y Y
4PreviewImageOffset YY YY Y Y
5PentaxModelID YY YY Y Y
6Date (Numeric) YY YY Y Y
7Time (Numeric) YY YY Y Y
8Quality YY YY Y Y
9PentaxImageSize YY YY - -
10UNKNOWN YY -- - -
12FlashMode YY YY Y Y
13FocusMode YY YY Y Y
14AFPointSelected YY YY Y Y
18ExposureTime YY YY Y Y
19Aperture YY YY Y Y
20Sensitivity YY YY Y Y
22Compensation YY YY Y Y
23MeteringMode YY YY Y Y
24BracketingStep YY YY Y Y
25WhiteBalance YY YY Y Y
26WhiteBalanceMode YY YY Y Y
29FocalLength YY YY Y Y
31Saturation YY YY Y Y
32Contrast YY YY Y Y
33Sharpness YY YY Y Y
34HomeOrAway YY YY Y Y
35HomeTownCity YY YY Y Y
36AwayTownCity YY YY Y Y
37HomeTownDST YY YY Y Y
38AwayTownDST YY YY Y Y
39UNKNOWN YY YY Y Y
40UNKNOWN YY YY Y Y
41FrameNumber YY ** - -
43UNKNOWN YY YY - -
44UNKNOWN YY YY - -
45UNKNOWN YY YY Y Y
50UNKNOWN -- Y- Y -
51PictureMode YY YY Y Y
52DriveMode YY YY Y Y
53UNKNOWN YY YY - Y
54UNKNOWN YY YY - -
55ColourSpace YY YY Y Y
56ImageAreaOffset -Y -Y - Y
57RawImageSize -Y -Y - Y
58UNKNOWN YY YY - -
59UNKNOWN -Y -Y - -
60UNKNOWN YY -- - -
61UNKNOWN YY YY Y Y
62UNKNOWN YY YY Y Y
63Lens Identification YY YY Y Y
64UNKNOWN ----- Y -
65DigitalFilter -- Y- Y -
71UNKNOWN -- YY Y Y
72UNKNOWN -Y YY Y Y
73Noise Reduction YY YY Y Y
77UNKNOWN ----- Y Y
79UNKNOWN -- YY Y Y
80UNKNOWN -- -Y Y Y
81UNKNOWN -- -Y - -
82UNKNOWN -- -Y - -
83UNKNOWN -- -Y - Y
84UNKNOWN -- -Y - Y
85UNKNOWN -- -Y - Y
86UNKNOWN -- -Y - Y
87UNKNOWN -- -Y - Y
88UNKNOWN -- -Y - Y
89UNKNOWN -- -Y - Y
90UNKNOWN -- -Y - Y
92UNKNOWN ----- Y Y
93UNKNOWN -- ** Y Y
98UNKNOWN ----- Y Y
512BlackPoint YY YY Y Y
513WhitePoint YY YY Y Y
514UNKNOWN YY YY - -
515UNKNOWN YY -- - -
516UNKNOWN YY -- - -
517UNKNOWN YY YY Y Y
518UNKNOWN YY YY Y Y
519UNKNOWN YY YY Y Y
520UNKNOWN YY YY Y Y
521UNKNOWN YY YY Y Y
522UNKNOWN YY YY Y Y
523UNKNOWN YY YY Y Y
525PresetScale1 YY YY Y Y
526PresetScale2 YY YY Y Y
527PresetScale3 YY YY Y Y
528PresetScale4 YY YY Y Y
529PresetScale5 YY YY Y Y
530PresetScale6 YY YY Y Y
531PresetScale7 YY YY Y Y
532PresetScale8 YY YY Y Y
533UNKNOWN YY YY Y Y
534UNKNOWN YY YY Y Y
538UNKNOWN -- -* - Y
539UNKNOWN -- -Y - Y
540UNKNOWN -- -Y - Y
541UNKNOWN -- -Y - Y
542UNKNOWN -- -Y - Y
543UNKNOWN -- YY Y Y
545UNKNOWN ----- - Y
546UNKNOWN ----- Y Y
547UNKNOWN ----- - Y
548UNKNOWN ----- - Y
1023UNKNOWN YY YY Y Y
1024UNKNOWN -Y -Y - -
1025UNKNOWN -Y -Y - -
1026ToneCurve YY -- - -
1027ToneCurves -- -Y - -
1028UNKNOWN ----- - Y
1029UNKNOWN ----- - Y


Tag 41 (Frame Count) is present in images from the DS, but not in those from the DL.

Tag 93 is absent in images from the DS, but shows up in images from the DL.

Tag 538 is not present in DS images, but appears in PEF images from the DL.


Copyright © John Francis. Unauthorised use or reproduction prohibited.

Comments or suggestions? Please email me at johnf@panix.com