Skip to main content

LFP (Light Field Photography) File Reader

Project description

LFP (Light Field Photography) File Reader


*Version 1.4*

Provides a Python library and command-line scripts to read Lytro LFP files, and
a simple viewer for Lytro LFP Picture files.

Technically, there are two types of LFP files: Picture and Storage. LFP
Storage files are used to store the data and configurations for Lytro cameras,
and LFP Picture (.lfp) files are used to store RAW and/or processed data for
Lytro light-field pictures.

This is a pure-Python package and should work on any platform. Please report
any problems at <>.

LFP File Format

*LFP* is a new file format used in *Lytro Light Field* cameras for the RAW and
Processed picture files, as well as storing camera information in the Lytro
Desktop library.

**LFP Picture** files have a ``.lfp`` extension, and among these, the name of
the processed picture files end in ``-stk.lfp``, where *stk* stands for
refocuse "stack". Embadding JPEG data with some additional refocus data, the
``stk.lfp`` files are designed to be used in the Lytro Desktop application and
on the web.

**LFP Storage** files embed various data files, which are identified by a
pathname, i.e. ``C:\CALIB\WIFI_MAC_ADDR.TXT``.

LFP Scripts

This package provides the following command-line scripts.

Picture Viewer


A small application to view and *refocus* LFP Picture files.
You may provide the name of the Processed LFP Picture file in the

./ samples/IMG_0001-stk.lfp

*NOTE: This script requires Python Imaging Library (`PIL` or its fork, `Pillow`) to run.*

All-Focused Picture


Creates an all-focused image using a Processed LFP Picture file.::

./ samples/IMG_0001-stk.lfp

*NOTE: This script requires Python Imaging Library (`PIL` or its fork, `Pillow`) to run.*

File Information


Provides general information about any LFP file, including the metadata and
the data chunks (data size and their sha1 ids).::

./ samples/IMG_0003.lfp

You may also pass the sha1 id to the command line to get the content of the
data chunk in standard output.::

./ samples/IMG_0001.lfp sha1-992ae2d9f755077e50de7b9b1357e873885b3382


Provides detailed information about a picture file.::

./ samples/IMG_0003.lfp

The *Frame* section provides the information about the RAW picture data, and
the *RefocusStack* section provides the information about the processed image
data, including the number of JPEG files and the size of the depth table.
You will also get a preview of the depth table.


Providing a list of embedded files in an LFP Storage file.::

./ data.C.0



Exports metadata and data sections of a generic file into separate files.::

./ samples/IMG_0001.lfp


Exports raw and processed data of a picture file into separate files.::

./ samples/IMG_0001.lfp
./ samples/IMG_0001-stk.lfp


Exports all the embedded files of a storage file into separate files.::

./ data.C.0

If you give the script a path, you get the content of that specific file
in the standard output.::


LFP Reader Library

**LFP Reader library (``lfp_reader``)** provides direct reading access to all
data and metadata in any LFP files. For the processed LFP Picture files, you
can easily access the JPEG data and the depth table. And for LFP Storage files,
you can access embedded files easily using their pathname.

The main classes in the ``lfp_reader`` package are:

- ``LfpGenericFile``
- ``LfpPictureFile``
- ``LfpStorageFile``

Code License

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <>.

Legal Notice

This project is NOT affiliated with LYTRO, INC. Lytro (R) is a trademark of

Some of this work is based on Nirav Patel's ``lfptools`` project and his
analysis on LFP file format. <>

Copyright (C) 2012 Behnam Esfahbod. <>

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lfp-reader-1.4.7.tar.gz (23.3 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page