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:

i-pfmcolourexposure[filmcurv]llapeqzonescontrastdehazegradecurvesgraddeconvgraino-pfm

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

ModuleAlgorithmWhat it does
colourCAT16 chromatic adaptationWhite balance (temperature in Kelvin) and saturation
exposureLinear multiplyEV adjustment in linear light
filmcurvWeibull parametric curveScene-to-display film curve with hue preservation
llapLocal Laplacian pyramidHighlights, shadows, and clarity at multiple scales
eqFrequency decomposition6-band spatial frequency equalizer + edge control
zonesLuminance partitioning7-zone system mapping (shadows through highlights)
contrastGuided filterEdge-preserving local contrast enhancement
dehazeDark channel priorAtmospheric scattering removal with depth estimation
gradeACES CDLLift/gamma/gain color grading with pivot control
curvesClamped cubic splineInteractive tone curve with per-channel control
gradGradient densityGraduated neutral density filter with rotation
deconvRichardson-Lucy deconvolutionReverses optical blur (true sharpening)
grainSimplex noiseLuminance-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."