Work 09 / 18
Colour correction with a lookup table made for each photo
Auto-boost corrects the colour and exposure of each photo with a 3D lookup table built for that photo. I fixed banding in dark rooms, made its controls signed, and removed a wasted JPEG round-trip.

Warm cast addedWhite-balanced
Cool cast addedWhite-balanced
Green cast addedWhite-balancedPhotos: Kitchen, Paul Schweiker House and Studio, Me… by w_lemay, CC BY-SA 2.0; Sustainable Kitchen - Flickr - Jeremy Levine… by Jeremy Levine from Los Angeles, United States, CC BY 2.0; Munsell House, Park Street, South Royalton,… by w_lemay, CC BY-SA 2.0. What I changed.
- Whole system
- under 30 MB
- Predictor, tables and white balance
- Shadow gain
- 3.4× → 2.2×
- To stop banding in dark areas
- Controls
- −100 to 100
- Signed, with the same rendered output
- Quality metric
- none
- Checked by eye
How it works
It is based on Image-Adaptive-3DLUT. A small predictor looks at the photo and outputs weights for a set of learned basis lookup tables. Their weighted sum is a 3D colour table made for that photo, applied with custom C++ trilinear interpolation.
Inside and outside photos have separate profiles, chosen by the scene classifier. Outside photos get a fixed table first, and a white-balance network removes colour casts.
What I fixed
- Banding in dark rooms. A quantised lookup table amplifies whatever noise is in the input. I removed a per-tile contrast step (CLAHE) that caused mottling, and halved the shadow lift from 0.4 to 0.2, which takes the gain from 3.4× to 2.2×.
- Confusing controls. The knobs now run from −100 to 100, and highlights point the same way as the rest. Existing settings were remapped so the rendered output stayed byte-identical, and the inputs are clamped so grey or black frames cannot break them.
- A wasted step. The service decoded and re-encoded every JPEG only to attach EXIF data. I removed the round-trip.
Limits
There is no number for colour quality here. Changes were checked by eye and by comparing outputs. The banding fix trades some shadow lift for cleaner dark areas.
Tools
Image-Adaptive-3DLUT, PyTorch, C++ (trilinear interpolation), OpenCV.
Builds on Image-Adaptive-3DLUT (Zeng et al.).
The full write-up
There is a longer write-up of this project. It has client details in it, so email me if you’d like a redacted copy.