brought to you by Deparment of Optics & Acoustics

the database

The Lytro Desktop stores metadata about the pictures and stories in a local database. The database is powered by SQLite, an engine storing data in isolated files. In this case, it is the database.db (library.db on Mac) file right in the Lytro library.

Not owning a Mac, I am unable to track updates there. See the archive page for Mac for database in the first version of the Lytro Desktop.

The database is required for the desktop software only. Although it too contains picture metadata, these are only duplicated from the picture files for performance purposes.


gid (PK, int, not null)import group identifier, identity(1, 1)

On every import from the camera, new group or groups of pictures are created. Each group contains at most 31 pictures, named IMG_0001.lfp to IMG_0031.lfp. In the Lytro library, groups are represented by subfolders of the images folder. The name of the subfolder is the respective gid value in the hexadecimal, two digit format.

Note that the groups are created during import. If you connect the camera to another computer, the same pictures will be imported into different groups, depending on previous imports to that computer. This makes archiving of the pictures very difficult.

id (PK, text, not null)picture hash

The purpose of the this table is to remember which pictures were already imported to the computer and which not. When a camera is connected to to the computer, it returns a list of hashes of pictures that are available. The Lytro Desktop checks this table and asks for the pictures it has never seen.

This is why a picture cannot be undeleted by reimporting it even if it is still in the camera. As everywhere else, the hash used is SHA1, however, nothing from the library yields to the hash values in id. So although you could make the reimport to happen by removing the correct hash, there is no obvious way how to find which one is it. Still, used SQLite version seems to return text primary keys in the insert order and the picture identifier is an identity column, so the pid value corresponds to the zero-based row number of the imported_pictures table.

pid (PK, int, not null)picture identifier, identity(0, 1)
gid (FK, int, not null)import group identifier
eid (FK, int, not null)story identifier, indexed
name (text, not null)LFP file name with extension
starred (int, not null)1 if picture marked as favorite, 0 otherwise
turns (int, not null)0 not rotated, 1 rotated 90°, 2 rotated 180°, 3 rotated 270° counter-clockwise (in the desktop software)
lambda (real, not null)depth at which the picture was focused (the lesser number the closer to lens)
caption (text, not null)description of the picture entered in the desktop software
date (text, not null)the date the picture was taken, ISO 8601 format
iso (int, not null)sensitivity the picture was taken with
fnumber (real, not null)aperture the picture was taken with
shutterspeed (real, not null)exposition time the picture was taken with
broken (int, not null)1 if the picture could not be rendered (corresponding file has .lf_ extension in the library), 0 otherwise
focallength (real, not null)zoom factor, for the A1 model ranging from 42.973 to 340.8256
creativemode (int, not null)1 if picture taken in creative mode, 0 otherwise
row (int, not null)visual order of the picture within a story (0 for the first one)

Main table for pictures, pretty self-describing. The metadata are cached from the picture files, for the info panel of the desktop software. Modifying them does not modify the underlying files. The caption is not part of the image file at all.

eid (PK, int, not null)story identifier, identity(1, 1)
time (datetime, not null)date and time when the story was created
title (text, null)name of the story
collapsed (int, not null)1 if the story is collapsed in the software, 0 if expanded (pictures visible)
row (int, not null)visual order of the story (0 for the top most story on the desktop)

This is the table for stories created in the desktop software. Each picture can be in one story only.

Apart from the tables above, the database file contains also two system tables, schema_version and sqlite_sequence. Database encoding is UTF-8.


All thumbnails are together in the thumbs folder of the Lytro library. There are two images for each picture, the color one with 300 × 300 pixels, and the grayscale one with 128 × 128 pixels. They are named pic_00000.jpg resp. pic_00000_lo.jpg, where 00000 stands for the picture identifier value, pid, so the table is needed to match them to the original files.

The thumbnails are regenerated when the picture is refocused in the desktop software, to reflect the selected focus point. Prior to this, the point touched on the camera is used.

When a picture is deleted from the desktop software, so are both the thumbnails.

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