brought to you by Deparment of Optics & Acoustics

the file format

There are couple of file patterns through the Lytro library, depending on your platform and version:

raw.lfp (IMG_0000.lfp)

These are the raw files from camera. They contain:

The package metadata contain the metadata version, references to all the above components and whether the picture was marked as favorite. Also whether the image is a dark or modulation frame (only calibration images do have these set).

stack.lfp, stacklq.lfp (IMG_0000-stk.lfp)

These files are generated by the Lytro desktop software during importing pictures from a camera. They are considerably smaller (rarely above 1 MB) and they are the files used if you share the picture with someone using the software. Components:

The package metadata contain the metadata version, reference to the lookup table and references to all the prerendered images with a depth they represent, so that the viewers can just show the correct image. The only other metadata included is whether the image was marked as favorite (and dark/modulation, see above), specially, there is no information about when the picture was taken, the caption that it was given, its iso, shutter speed etc. in the files published online.

stack_filtered.lfp, stacklq_filtered.lfp

The same files as above, except that the selected filter is applied to the prerendered images.

dm.lfp (IMG_0000-dm.lfp)

This is separate file containing depth map only. Components:

data.C.#

These are just packages for other files, as noted in the backup.

The package metadata contains list of file names present in the package and references to them, with an optional information which package file to continue with (since the generated packages tend to not have much more than 256 MB). Then, the files themselves are the individual components of the package.

On Windows, these files can be found at %LOCALAPPDATA%\Lytro\cameras\sn-##########. On Mac, they are in the package at Lytro.lytrolib\cameras\sn-##########.

*.calib

Newer Lytro Desktop versions drop further calibration data into %LOCALAPPDATA%\Lytro\cameras\ folder, containing H.264 encoded bitmap groups for calibrating the compression algorithm. Note that these files, perhaps due to an error, must be preprocessed to become valid packages, by changing all CR LF bytes to LF.

the specification

As noted above, the packages consists of components, laid one after other. The specification of each component is as follows:

89 L F _ 0D 0A 1A 0A VE VE VE VE CL CL CL CL (header with component type, version?, data length) s h a 1 - 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 (component name) __ __ __ __ __ __ __ __ __ __ __ __ 00 00 00 00 (component data, null padding)

bytesnotes
0‑7Constant 8 bytes header, the fourth byte determines the component type, which can be one of these:
  • P (package), always the first component in the file
  • M (metadata), in Lytro files always the second component in the file and always the only one
  • C (component), any other component
This makes the file easily identifiable as the first line always reads ‰LFP when opened in a text editor.
8‑11Probably version of the file format specification, big endian integer. Currently all Lytro files have 00 00 00 01, but only in the first (i.e. LFP) component. Other components have 00 00 00 00.
12‑15Length of data in the component, big endian integer. This value can be zero, in which case this is the end of the component and the next component follows immediately. Currently the LFP component has always zero length.
16-96Name of the component. The name can have up to 80 bytes, shorter names are padded with zeros to the total length of 80. Several components can have the same name.
Lytro chose to name all components using the SHA1 hash of the component data. For example, the component containing CALIB\HW_VERSION.TXT from the backup has the name “sha1-0ebc94cc825e8c4c1defb3e5c0ca5ae5e7be0620”. Yes, all hash functions have collisions, but as noted the name is not required to be unique.
97‑The actual data of the component. Length of data is specified by the number at bytes 12‑15.
*Every component is padded with zeros so that the total length of the component (i.e. header + version + data length + name + data + padding) is multiple of 16. If the sum without padding is already a multiple of 16, then no padding is added.

The files do not have any special opening or closing.

Disclaimer: Jan Kučera and miloush.net are not affiliated with or endorsed by Lytro, Inc. and the above information is not confirmed.