The Vulkan Compute Pipeline
At the heart of Chromaform is a 15-module GPU compute pipeline running through MoltenVK. Each module is a Vulkan compute shader that processes the entire image in a single dispatch. This is what separates Chromaform from editors built on Apple's CoreImage framework.
Pipeline Architecture
When you adjust any slider, the image flows through this chain:
Modules in brackets are conditional (filmcurv only in scene-referred mode). The resize module is inserted for preview resolution and skipped at full resolution.
Module Reference
| Module | Algorithm | What it does |
|---|---|---|
colour | CAT16 chromatic adaptation | White balance (temperature in Kelvin) and saturation |
exposure | Linear multiply | EV adjustment in linear light |
filmcurv | Weibull parametric curve | Scene-to-display film curve with hue preservation |
llap | Local Laplacian pyramid | Highlights, shadows, and clarity at multiple scales |
eq | Frequency decomposition | 6-band spatial frequency equalizer + edge control |
zones | Luminance partitioning | 7-zone system mapping (shadows through highlights) |
contrast | Guided filter | Edge-preserving local contrast enhancement |
dehaze | Dark channel prior | Atmospheric scattering removal with depth estimation |
grade | ACES CDL | Lift/gamma/gain color grading with pivot control |
curves | Clamped cubic spline | Interactive tone curve with per-channel control |
grad | Gradient density | Graduated neutral density filter with rotation |
deconv | Richardson-Lucy deconvolution | Reverses optical blur (true sharpening) |
grain | Simplex noise | Luminance-dependent film grain |
Why Vulkan?
Apple's CoreImage framework is optimized for simple per-pixel operations (color adjustments, blur, compositing). But algorithms like Local Laplacian pyramids, frequency decomposition, and deconvolution require multi-pass GPU compute with shared memory, workgroup synchronization, and complex data dependencies. These are natural fits for Vulkan compute shaders but impossible to express as CIFilter chains.
Chromaform runs Vulkan on iOS through MoltenVK, which translates Vulkan API calls to Metal. The 384 pre-compiled SPIR-V shader files are bundled with the app and loaded at startup.
Tiled Rendering
For images larger than 4000px on either dimension (roughly 16 megapixels), the pipeline splits the image into overlapping tiles. Each tile includes 256 pixels of context on each side so that neighborhood-aware modules (llap, dehaze, eq) have sufficient data at tile borders. The tiles are processed sequentially through the full pipeline, then composited into the final image.
This allows Chromaform to process 50+ megapixel RAW files at full sensor resolution on an iPad or iPhone with 8 GB of RAM. A progress modal shows tile-by-tile status during rendering.
Processing Modes
Display-Referred (Default)
Input is sRGB gamma-encoded (JPEG, HEIC, or CIRAWFilter with standard processing). The pipeline processes the data directly. The filmcurv module is skipped because the image is already display-ready.
Scene-Referred
Input is linear (CIRAWFilter in linear mode with exposure=0, NR=0, sharpening=0, lens correction ON). The colour and filmcurv modules handle the scene-to-display transform. This gives access to the full film curve controls and proper color science. Toggle in the Edit panel under "Processing Mode."