🎨Quick Photo Filters (Grayscale, Sepia & Contrast) Documentation & Guide
📋How to Apply Offline Photo Filters
- Load Source Photo: Upload a PNG/JPG/WebP image or choose an editorial filter preset.
- Tune Filter Sliders: Adjust Grayscale (0–100%), Sepia (0–100%), Contrast (50–200%), and Brightness (50–180%).
- Apply & Save PNG: Click Apply Filter to bake CSS filter transformations permanently into downloaded PNG pixels.
⚙️Baked HTML5 Canvas `ctx.filter` Color Matrix▼
Unlike CSS filters that only alter webpage display while leaving the downloaded image unchanged, painting through `CanvasRenderingContext2D.filter` executes SVG/GPU color-matrix convolutions permanently into exported pixels.
📐Formula & Mathematical Architecture▼
🧮Concrete Worked Examples▼
Grayscale 100%, Contrast 130%Crisp monochrome PNG + copyable CSS ruleBoosting contrast slightly avoids flat muddy shadows in pure grayscale.
Sepia 85%, Contrast 110%, Brightness 105%Warm amber-toned PNG imageSubtle sepia preserves rich highlights without washing out shadows.
⚠️Common Pitfalls & Edge Cases▼
- ⚠️Combining 100% Grayscale and 100% Sepia simultaneously expecting grayscale (Canvas applies filters left-to-right, so Sepia after Grayscale re-tints it brown!).
- ⚠️Pushing Brightness & Contrast to extremes on compressed low-res JPEGs (amplifies banding artifacts).
- ⚠️Forgetting to copy the CSS `filter` property if using the image directly in web styling.
💡Quick Editorial & Web Prep▼
- Converting headshots or scanned sketches into crisp high-contrast black-and-white prints.
- Testing CSS filter values on real photos before pasting into stylesheets.