A lenticular print hides several pictures under a sheet of tiny ridged lenses. Each ridge shows you a different strip of the pictures underneath depending on where your eye is, so tilting the print swaps one picture for another. Lenticle does the same thing with the motion sensors in a phone: the file carries several full pictures and a short description of the effect, and the viewer blends between them as you tilt.
The two halves
A Lenticle file has two kinds of content. Layers are the pictures, all the same size. Metadata is a small text block that says what should happen when the phone moves. The metadata only describes the intent; the viewer decides how to render it. That split is what lets the format stay simple while viewers get better.
Layers
Layer 0 is special. It is stored as an ordinary PNG, which means any program that opens PNG files will show it, even if it has never heard of Lenticle. Choose it as the picture that should survive on its own. In the grandmother example, layer 0 is the grandmother alone and layer 1 is the grandmother with the toddler, so a plain viewer sees a complete photograph and the Lenticle viewer adds the toddler as you tilt.
Layers 1 and up are stored inside the same file as complete JPEG or PNG images. The creator crops every picture to the shape of layer 0 and scales them all to the same size, because the viewer draws them exactly on top of each other. For the effect to look right, the pictures should line up: shoot or scan them in the same framing, or make the second from the first.
The axis
Everything the viewer does is driven by one number, t, that runs from −1 to +1. Zero is the rest pose, the angle you were holding the phone at when the file opened. Tilting one way pushes t toward +1, the other way toward −1. Each layer sits at a position on this axis, called at. The viewer finds the two layers on either side of the current t and blends between them.
With two layers the creator places them at 0 and +1, so the rest pose shows layer 0 cleanly and tilting forward fades layer 1 in. Tilting backward stays on layer 0. With three layers the default is −1, 0 and +1: the middle picture at rest, one picture in each direction. You can type any positions you like in the creator; the only rule is they stay between −1 and +1.
Fields in the metadata
| axis | pitch is tilting the top of the phone toward or away from you, the way you would tip a print to catch the light. roll is tilting the phone left or right, like turning a steering wheel. Pitch is the default and matches the way flip prints are usually made. |
| range | How many degrees of tilt it takes to travel the whole axis from −1 to +1. The default of 40 means ±20° around the rest pose. A smaller range makes the effect snappier, a larger one gives finer control. Beyond the range the viewer simply holds the end picture. |
| transition | crossfade dissolves one layer into the next, the ghosting you see on a real print half way through a tilt. cut switches hard at the midpoint, like a print with a very sharp lens. |
| curve | Shapes the crossfade. linear maps tilt to opacity one to one. smoothstep holds each picture a little longer at the ends and moves faster in the middle, which feels closer to a lens flipping over. Ignored when the transition is cut. |
| layers[].at | Where each layer sits on the axis, as described above. |
| layers[].label | A name for your own reference. Viewers may show it; nothing depends on it. |
Anything a viewer does not recognise it ignores. Unknown values fall back to the defaults with a warning in the status strip. The version number at the top of the metadata lets a future viewer tell a v1 file from a later one.
What the viewer does
- Sensors. The page listens to the phone's orientation, which the operating system already fuses from the gyroscope and accelerometer into pitch and roll angles. iPhones require a tap on Enable motion before the browser will share them, and only on a secure HTTPS page.
- Rest pose. The first fraction of a second of readings becomes "zero". Recenter takes the current angle as the new zero, useful after you sit down or change hands.
- Smoothing. Raw sensor angles jitter. The viewer runs them through a One Euro filter, which smooths hard when the phone is still and loosens up when you move it, so the picture neither shivers nor lags.
- Drag fallback. On a desktop, or when no sensor is available, drag on the picture. Vertical drags drive pitch files, horizontal drags drive roll files. A drag across about 60% of the frame covers the whole axis.
- Fallback picture. If the file is not a Lenticle at all, or is damaged, the viewer still shows layer 0 and tells you why in the status strip. It never shows a blank frame for something that is still a valid PNG.
- Inspect. Lists every chunk in the file with its offset, length, checksum result and meaning, plus the first bytes in hex. It is the same view a hex editor gives you, with the parts labelled.
What the creator does
- Decodes each picture, respecting camera rotation stored in the photo.
- Scales layer 0 so its longer side is at most Max edge pixels, then crops every other layer to the same frame, centred. 1600 pixels is plenty for a phone screen and keeps files small.
- Encodes layer 0 as PNG. Extra layers use the codec you pick: JPEG at the given quality keeps the file small, PNG keeps every pixel. A photograph rarely needs PNG.
- Assembles the file, immediately re-reads it to check it is valid, and shows a slider so you can scrub through the effect before downloading.
- Offers two downloads of the same bytes. The
.lntname tells people what it is. The.lnt.pngname lets any photo app open it and shows layer 0.
How the file is built
A PNG is a signature followed by a list of chunks. Each chunk is a length, a four letter type, the data, and a checksum. PNG lets anyone add private chunk types as long as the first letter is lowercase, which tells decoders they may skip it. Lenticle adds two.
89 50 4E 47 0D 0A 1A 0A PNG signature IHDR width, height, bit depth, colour type lnMD metadata, UTF-8 JSON ← ours IDAT layer 0 pixels ← what any viewer shows lnLY layer 1: 8-byte header + JPEG ← ours lnLY layer 2 ... ← ours IEND
The metadata goes before the pixels so a reader knows what it has before downloading the big part. The extra layers go after the pixels so layer 0 can appear before the rest arrives. Each extra layer starts with an eight byte header giving its index, its codec, and its width and height, followed by a complete image file. The viewer hands that image to the browser to decode, so it needs no decoder of its own.
Every chunk, including ours, carries a CRC-32 checksum. If a byte is damaged in transit the viewer notices and falls back to layer 0 with a message naming the chunk. The full byte-level description is in the spec.
Tips for good results
- Pick the layer 0 you would be happy to see on its own, since that is what every other app will show.
- Keep the framing identical between layers. The effect is strongest when most of the picture stays put and one thing changes.
- Try range 30 for a quick flip and 60 for a slow reveal.
- Three layers at −1, 0, +1 make a short story: before, now, after.
- Share the file by AirDrop, Files or a direct link. Messaging apps usually re-encode pictures and would strip the extra layers, leaving layer 0.