Creator Js | Lut
This guide is structured like a mini interactive workshop. From Pixel to Palette: Real-Time Cinematic Color in the Browser ๐ Part 1: What is LUT Creator JS? LUT Creator JS is a lightweight, dependency-free JavaScript library that applies 3D Lookup Tables (LUTs) to images or video frames.
lutCreator.loadLUTFromData(lutData, size); | Source | Type | Best for | |--------|------|----------| | LUTs by IWLTBAP | Free packs | Cinematic / Moody | | FilterGrade | Paid / free | Vintage, Film stocks | | Generate your own using LUT Generator | Web tool | Custom looks | | Extract from Photoshop .cube | Export from PS | Professional grades | ๐จ Make your own LUT: Use DaVinci Resolve (free), grade a clip, export as 33x33x33 .cube, then drop into LUT Creator JS. โก Part 6: Performance Tuning (Expert Tips) | Setting | Recommendation | Why | |---------|---------------|-----| | LUT size | 33ยณ or 49ยณ | Higher = smoother but slower. 33ยณ is sweet spot. | | Canvas pixel ratio | devicePixelRatio | Match screen for sharpness, but cap at 2x for performance. | | Update mode | requestAnimationFrame | Never apply LUT in a tight loop without throttling. | | WebGL precision | highp (default) | Avoid color banding on gradients. |
// Enable turbo mode for HD video lutCreator.setPrecision('mediump'); // less GPU memory lutCreator.setLUTInterpolation('trilinear'); // faster than tetrahedral lutCreator.setQuality(0.8); // optional downscale factor โ "My LUT makes everything black" โ Check if your .cube uses 0-1 float range (not 0-255). LUT Creator JS expects normalized RGB. lut creator js
โ โ Use lutCreator.setMaxTextureSize(1024) to limit memory.
๐จ
const img = document.getElementById('source-img'); img.onload = () => lutCreator.loadImage(img); ;
// Load a .cube LUT file document.getElementById('lut-upload').onchange = (e) => const file = e.target.files[0]; lutCreator.loadLUTFromFile(file).then(() => lutCreator.applyLUT(); // Magic happens here ); ; </script> </body> </html> 3D LUTs in 30 seconds: Instead of adjusting brightness/contrast one slider at a time, a 3D LUT maps every input color (R,G,B) to a new output color (R',G',B') using a 3D grid. This guide is structured like a mini interactive workshop
<script> const lutCreator = new LUTCreator( canvas: document.getElementById('output-canvas'), type: 'webgl' // falls back to CPU automatically );