Image colour replace
Repaint pixels close to a target colour (the top-left pixel by default) with another colour, or make them transparent; both the distance threshold and alpha handling are adjustable, then export PNG or JPEG.
Runs in your browserEvery computation happens in your browser — your data never leaves this device.
Images are processed locally in your browser with Canvas and never uploaded.
Blank or "transparent" auto-picks the top-left pixel as the target colour.
Enter #rrggbb; blank or "transparent" makes the matched pixels transparent (the same as removing the colour).
Euclidean RGB distance from 0 to 442; 30 is precise, 60 and above also catches similar shades.
Pick an image first (PNG / JPEG / WebP / GIF all work).
Result details
Pick an image and colours are replaced according to the threshold right away; the preview and counts update live.
What this tool does
- Rework a theme colour: swap the blue buttons in a UI screenshot for your brand colour — a threshold around 30 hits precisely.
- Unify assets: replace an old brand colour across a set of icons without going back to the design file.
- Double as background removal: leave "replace with" blank and matched pixels become transparent, which is the same as removing a colour.
- Different from the colour removal tool: that one only makes pixels transparent, this one writes new RGB so you can repaint rather than delete.
Example
Input
A 3×1 image of [200,0,0], [255,0,0] and [0,0,255] with target #ff0000, replacement #00ff00 and threshold 30
Output
The red pixel becomes [0, 255, 0, 255] while dark red and blue stay untouched
From the pure replaceColor logic: dark red (200,0,0) is 55 away from the target, above the threshold of 30, so it is not replaced. Raising the threshold to 60 repaints both red pixels green.
Frequently asked questions
What happens if "replace with" is blank?
Blank or "transparent" makes matched pixels transparent (RGB and alpha zeroed), which behaves exactly like the colour removal tool. Fill in a #rrggbb to repaint instead.
How do I pick the threshold?
0–30 for exact swaps, 40–80 when JPEG noise or near shades should be included. Beyond about 120 clearly different colours start being caught, so watch the "replaced pixels" count.
Will transparency be damaged?
By default "preserve original transparency" is on: only RGB is written and alpha is untouched. Turning it off forces alpha 255 on replaced pixels, which suits opaque photos.
Why are some pixels not replaced?
The distance is computed per pixel, so anti-aliased edges and compression noise drift away from the target colour. Raise the threshold to cover more, or confirm the exact target — the result panel shows the colour actually used.
Are my images uploaded?
No. Pixels are read through the canvas and processed entirely in the browser; there is no upload endpoint on the page.
Keywords:replace colorrecolor image