File types · Explainer

The PEF file (.pef)

A PEF file is a raw photo from a Pentax camera: the sensor's data before processing, in a TIFF-based file with a JPEG preview and Pentax's settings. This guide explains what's inside one, why Pentax and Ricoh cameras can record DNG instead, and how to open, edit and convert PEF files.

At a glance

Full name
Pentax Electronic File, Pentax's raw image format
Extensions
.pef
MIME type
None registered; image/x-pentax-pef is used by ExifTool and Linux desktops
Kind
Binary camera raw image based on TIFF: sensor data (compressed or not), a JPEG preview, Exif and Pentax maker notes
Standard or owner
Pentax, now Ricoh Imaging. No public specification
In use
Pentax digital SLRs from the *ist D (2003), the first Pentax DSLR, to current K-mount models
Bit depth
12-bit on early models such as the *ist D; 14-bit on recent ones such as the K-3 Mark III Monochrome
Magic number
4D 4D 00 2A (MM, a big-endian TIFF header), with PENTAX and the maker-note header AOC soon after, per PRONOM
Opens with
Pentax Digital Camera Utility 5, Lightroom and Photoshop (Camera Raw), darktable, RawTherapee, macOS Photos and Preview, Windows Photos with the Raw Image Extension

The basics

What is a PEF file?

PEF is the raw format of Pentax cameras. It goes back to Pentax's first digital SLR, the *ist D of 2003, and is still offered by current K-mount bodies such as the K-3 Mark III. Pentax's camera business is part of Ricoh Imaging, which now makes the cameras and their software.

Like every camera raw format, a PEF holds what the sensor measured, before the camera's processing. Each value is the brightness under one coloured filter. A raw developer interpolates full colour for every pixel, applies white balance and a tone curve, and only then do you have a photo. Because PEF files keep 12 or 14 bits per value, you can recover highlights and shadows and set white balance afterwards, which a JPEG doesn't allow.

The catch is the usual one for raw files: a freshly opened PEF can look flatter and duller than the camera's JPEG, because the editor hasn't applied the camera's look. That's a starting point, not a fault.

Anatomy

What's inside a PEF file

Pentax doesn't publish the PEF format, but it's an ordinary TIFF on the outside, so its layout is well known from reverse engineering. This outline combines PRONOM's signature for the format (fmt/1781) with ExifTool's documentation of the Exif and Pentax tags. Tags shown are ones the documentation lists for PEF files; their positions and the full tag set vary by camera. It isn't a dump of a real file, and none is offered for download.

IMGP0001.PEF (structure outline)
IMGP0001.PEF: structure outline (positions vary by camera)

offset  bytes                   part
000000  4D 4D                   "MM": big-endian
000002  00 2A                   42: a standard TIFF header
000004  xx xx xx xx             where IFD0 starts

IFD0    ordinary TIFF tags
          0103  Compression     65535 = "Pentax PEF Compressed"
          010F  Make            the maker; "PENTAX" appears early in the file
          0110  Model
          0111  StripOffsets    → the sensor data
          8769  ExifOffset      → Exif IFD

Exif IFD  exposure, lens, date and time
          927C  MakerNote       → Pentax maker notes

maker   41 4F 43 00             "AOC\0": Pentax maker-note header
notes   4D 4D                   their own byte order ("MM")
          0003  PreviewImageLength
          0004  PreviewImageStart   → a JPEG preview
          0008  Quality         4 = RAW, 7 = RAW (pixel shift enabled)
          0405  large data block found in PEF and DNG, not JPEG
          …     many more camera settings

raw     the sensor data: one value per pixel, 12 or 14 bits,
data    stored with Pentax's own compression
  1. 14D 4D 00 2A

    A real TIFF header

    MM (big-endian, from Motorola) and the number 42: the same first bytes as a big-endian TIFF. PRONOM's signature for PEF starts with exactly these bytes, which is why a generic tool may report a PEF as a TIFF.

  2. 2IFD0

    Standard tags first

    Image size, make, model and pointers to the data, as in any TIFF. The camera name appears here as text; PRONOM uses the string PENTAX to recognise the format.

  3. 30103 Compression 65535

    Pentax's compression

    TIFF has no standard code for raw sensor compression, so cameras use private values. ExifTool lists 65535 as Pentax PEF Compressed. Pentax doesn't document the method; raw decoders implement it from reverse engineering.

  4. 441 4F 43 00

    The maker-note header

    AOC and a null byte open Pentax's maker notes, followed by their own byte-order mark. The maker notes hold hundreds of Pentax-specific settings that only Pentax's software and tools like ExifTool decode in full.

  5. 50003, 0004

    The JPEG preview

    The length and position of a JPEG the camera made. Thumbnails, quick viewers and the camera's playback screen show this, not the raw data.

  6. 60008 Quality

    What kind of shot

    Value 4 means a normal raw file, 7 a raw file shot with Pixel Shift, where the camera combines several frames with the sensor moved slightly between them.

  7. 7raw data

    The sensor readings

    One value per photosite, each under a red, green or blue filter. Nothing has been demosaiced, white-balanced or tone-mapped yet: the raw developer does all of that.

Two raw formats

PEF or DNG: why Pentax cameras offer both

Most camera makers save raw files only in their own format. Pentax is an exception: since the K10D of 2006, one of the first cameras to support DNG natively, many Pentax SLRs let you choose between PEF and DNG in the menu. The K-3 Mark III Monochrome's specification, for example, lists RAW (14bit) as PEF or DNG. Ricoh's GR III and GR IIIx compacts go further and record raw only as DNG.

PEFDNG from the camera
OwnerPentax/Ricoh, unpublishedAdobe, published specification
StructureTIFF-basedTIFF-based
Sensor dataThe same readingsThe same readings
Pentax maker notesYesYes: ExifTool finds Pentax maker-note tags in both
Software that reads itRaw editors that support that camera modelMost raw editors, often even before they add the camera

The practical difference is compatibility. A DNG carries the colour information a raw developer needs inside the file, so software that understands DNG can usually open a new camera's files without an update. A PEF needs software that knows that specific camera. If you're unsure, DNG is the safer choice; if you already have a library of PEF files, there's no need to convert them while your software reads them.

Pixel Shift and special modes

Files shot with Pentax's Pixel Shift Resolution mode hold several frames. Some software supports only the normal raw files of a camera, or only one of the two formats for these modes; Apple's raw list, for instance, has footnotes for such limits. Test with your own editor before relying on it.

How to

How to open, edit and convert a PEF file

  • Pentax Digital Camera Utility 5: Ricoh's raw developer, included with Pentax cameras, for Windows and macOS. It develops raw files, saves JPEG and TIFF, and can convert PEF to DNG. Ricoh's updater page lists version 5.10.2 (February 2025).
  • Adobe Lightroom and Photoshop (Camera Raw): open PEF files from the models on Adobe's supported-camera list.
  • darktable and RawTherapee: free and open source, on Windows, macOS and Linux.
  • Mac, iPhone and iPad: Photos and Preview open PEF files from the Pentax models in Apple's raw list, which goes back to the *ist D.
  • Windows: install Microsoft's free Raw Image Extension, built on LibRaw, and Photos and File Explorer show PEF files.

From the command line, ExifTool can pull out the preview without developing the raw data, and show what the camera recorded:

terminal
# save the camera's JPEG preview
exiftool -b -PreviewImage IMGP0001.PEF > IMGP0001.jpg

# all metadata, grouped by where it's stored
exiftool -a -G1 IMGP0001.PEF

Troubleshooting

Why won't my PEF file open?

  • The camera is newer than the software. Raw support is added camera by camera. An older Lightroom, Photoshop or raw editor may reject the file or show only the preview. Update, or use Adobe's free DNG Converter, which rewrites PEF files from the cameras it knows as DNG for older software.
  • Only a small or low-quality picture appears. The program is showing the embedded JPEG preview because it can't decode the raw data.
  • A generic tool calls it a TIFF. It is one, structurally, but the image data is Pentax's raw sensor data. Ordinary TIFF viewers can't show it correctly.
  • Next time, avoid the problem. If your camera offers DNG, recording DNG instead of PEF makes files readable by more software straight away.

Comparison

PEF vs JPEG, HEIF and DNG

PEFDNGJPEGHEIF/HEIC
Processed in cameraNoNoYesYes
Bits per value12 or 14As recorded88 or 10
Edit white balance laterFullyFullyOnly roughlyOnly roughly
Readable without camera-specific supportNoMostlyYesYes
Good for sharingNoNoYesYes, where supported

Keep PEF or DNG files as your originals and share JPG exports. Raw files are several times larger than a JPEG of the same shot, and nobody can view them in a browser.

Privacy

Metadata in PEF files

Pentax's maker notes are detailed. Besides the usual Exif date, time and exposure, ExifTool reads a camera serial number, lens information and, on cameras with built-in GPS or a GPS accessory, the location. All of it travels with the file.

Before sending raw files to people you don't know, check them with exiftool -a -G1 file.pef. For public sharing, export a JPEG with metadata removed instead. PEF files contain no scripts or macros; the risk of a crafted file is limited to bugs in raw decoders, so keep raw software updated.

Sample files

There are no sample PEF files on this page. Raw files come straight from the camera, so the simplest test file is one shot on a Pentax camera set to RAW with the PEF option.

Put it online

Have a PEF file? Give it a link.

Drop a Pentax raw file on 99helpers and it gets its own web address. Browsers can't display raw files, so anyone who opens the link downloads it to develop in their own software; add a JPEG if people just need to see the photo.

Questions

PEF files, frequently asked

What is a PEF file?

A raw photo from a Pentax camera: the unprocessed sensor data, a JPEG preview and the camera's settings, in a TIFF-based file.

How do I open a PEF file?

Use Pentax Digital Camera Utility 5, Lightroom, Photoshop, darktable or RawTherapee. On a Mac, Photos and Preview open them; on Windows, install Microsoft's Raw Image Extension.

Should I shoot PEF or DNG on my Pentax?

Both hold the same sensor data. DNG opens in more software without updates; PEF is Pentax's own format. If you're unsure, DNG is the more compatible choice.

How do I convert PEF to DNG?

Use Pentax Digital Camera Utility 5 or Adobe's free DNG Converter. Keep the original PEF files as a backup.

How do I convert PEF to JPG?

Open the file in a raw editor or Preview and export as JPEG. exiftool -b -PreviewImage file.pef > file.jpg extracts the camera's own preview without editing.

Why does my PEF look different from the photo on the camera?

The camera showed its own processed JPEG preview. Your editor develops the raw data with its own defaults, which are often flatter. Adjust it, or choose a camera-matching profile.

Is PEF the same as TIFF?

It uses TIFF's structure, so the first bytes are a TIFF header, but the image inside is raw sensor data that ordinary TIFF viewers can't display properly.

Related formats

Other file types explained

Keep going

Related

Sources

Last reviewed 27 October 2026.