Convert images to grayscale or sepia, privately
Turn any photo black and white, or apply a warm sepia tone. This is useful for print layouts, accessibility mock-ups, vintage effects, or simply reducing visual noise — and it all runs locally so your photos never leave your device.
How it works
The image is loaded into a <canvas> and read with getImageData. For each
pixel the chosen formula computes a new value:
- Perceptual greyscale (default):
0.299R + 0.587G + 0.114B(ITU-R BT.601 luminance), which matches how the human eye weights brightness — green contributes most, blue least. - Simple average:
(R + G + B) / 3, treating all channels equally. - Sepia: the standard sepia matrix is applied for a warm tone.
The recomputed pixels are written back with putImageData and exported as a
lossless PNG.
Example
A mid-blue pixel with R=40, G=90, B=200:
- Perceptual: 0.299×40 + 0.587×90 + 0.114×200 = 87 (a dark grey)
- Simple average: (40 + 90 + 200) / 3 = 110 (noticeably lighter)
The perceptual result looks more natural because blue is perceived as darker than its raw value suggests.
Every pixel is processed with a <canvas> on your device — your image is
never uploaded — and the result downloads as a lossless PNG.