What is an MPO File?

A Multi-Picture Object file stores multiple JPEG images in one container. The images commonly represent separate views of a stereoscopic photograph, though the container can hold other related pictures.

How MPO Files work

MPO is the file form of the Multi-Picture Format, standard DC-007 of the Camera and Imaging Products Association (CIPA), first published in 2009 and revised since. The file begins as an ordinary JPEG. Its first image carries an APP2 application segment identified by MPF, which holds an index in TIFF directory form: the number of images and, for each one, a type, a size in bytes, and a data offset. The remaining images are complete JPEG streams appended after the first, where a JPEG-only reader sees only trailing data. That is why unaware viewers display a plausible picture while ignoring the rest. The format is best known from 3D cameras, whose files hold one image per viewpoint, but the index also types images as large thumbnails or as frames of a panorama or multi-angle set.

Key facts

  1. To find the embedded images, read the index instead of scanning for JPEG markers. The APP2 MPF segment lists the image count and one entry per image with its size and offset. Pillow, for example, resolves each offset relative to the start of the MPF header inside that segment, not the start of the file, and treats the first image as offset 0. All index values are needed to split the file safely, since each image can contain its own embedded thumbnails.
  2. Converting through a JPEG-only code path drops the additional images without an error. ExifTool describes them as data stored in the JPEG trailer, after the first image. Pillow loads only the primary image when an MPO is opened and reaches the others through seek. When writing an MPO file, save keeps only the first frame unless save_all is set or append_images is given. A plain JPEG output holds one image, so keeping both views of a stereo pair as JPEG means writing each view to its own file.
  3. The suffix is unreliable in both directions. Pillow reports the format MPO for any JPEG whose MPF index lists more than one image, which has surprised users whose camera .jpg files carry an extra large-thumbnail image; the maintainers closed that report because the file was a valid MPO. Code that branches on a detected format of JPEG should expect MPO for such files. Pillow makes one exception and keeps Ultra HDR files as plain JPEG.
  4. The embedded images are not interchangeable views, so read each entry’s type before extracting or discarding it. Types include the primary image, large thumbnails at several sizes, multi-frame panorama, disparity, and multi-angle images, and a gain map. A type can also be Undefined, so an unrecognized type does not make an image disposable. Android’s Ultra HDR format stores its gain map as an additional MPF image, but Google’s libultrahdr library writes that entry with an undefined type, and Android’s specification locates the gain map through XMP metadata instead. A gain map is not a photograph: it records how much to brighten each pixel of the primary image for an HDR display. Keeping only the primary image keeps the standard dynamic range picture and drops the HDR rendition. Each image is a full JPEG that can carry its own Exif data, so apply orientation and other metadata per photographic image. A gain map is the exception: Android’s specification requires it to match the primary image’s orientation and ignores its own Exif orientation and color profile.

When MPO Files matter

Detect the multi-picture structure when importing photographs from 3D cameras or other devices that store linked images, and extract every image when all of them are required, because JPEG-only software exposes just the first. Check for it in files named .jpg as well: the same structure is used for embedded large previews and for the gain map of Ultra HDR photos.

Sources

Turn media knowledge into a working pipeline

Connect uploads, processing, AI, storage, and delivery through one declarative API — with the encoding stack, scaling, and format churn handled for you.

Try Transloadit for free