Swap colors in an image.
Swap one color in an image for another and leave the rest untouched: white to black, red to blue, any pair. The tolerance takes in the color's shades and Keep shades keeps the result lit.
Swap colors in an image.
Need the UI around it? With Pro, your AI agent builds the form, the result card and the rest of the page from a prompt.
Get ProHow it works
4 steps, no account. It runs in your browser and nothing is uploaded.
Pick the color to swap
Drop the image and set From to the color to swap out.
Narrow the match
Turn on Preview matches and lower the tolerance until only that color is magenta.
Pick the new color
Set To to the new color; keep shades for photos, off for flat graphics.
Download
Download the PNG with only that color changed.
Related tools
More PNG tools. Every one free, in the browser.
Pricing
Build it with Pro
The tool is free. Pro adds 6,000+ blocks, premium templates and the MCP server, so your AI editor builds the product around it.
4.9/5 out of 5 · 150+ reviewsfrom 150+ founders and developers.
- Secure checkout via Stripe
- Code lives in your repo
- Keep what you've shipped if you cancel
- License terms
Questions and answers
Before you trust the result: what to know about the format, the limits, your data and the tools next to it.
Set From to #ffffff and To to #000000. Raise the tolerance a little so off-whites go too, and check with Preview matches. Only white pixels change; every other color stays as it was, which is what makes this different from inverting the image.
A hue or saturation adjustment moves every color, or a whole range, at once. A swap matches one color within a tolerance and changes it to one other color, leaving the rest alone. You decide exactly which color goes and what it becomes.
Turn on Keep shades. A red object in a photo is many reds, light and dark; the swap keeps each pixel's lightness and only moves the hue to blue, so it still looks lit. Without it every matched pixel becomes the same flat blue.
Yes. The tool changes only the red, green and blue values of matched pixels and leaves every alpha value as it was, so transparent, translucent and opaque areas stay exactly as transparent as before. The output is a PNG so that alpha is kept.
The original file is never changed; the tool works on a copy in memory and the download is a new file. To undo, drop the original again. For a chain of swaps, download after each step so you can go back one.
Tolerance decides how far a pixel's color may be from the From color and still be replaced, as a percentage of the distance between black and white in RGB. At 0 only exact matches change; at 10 to 20, shades around it change as well, which is what a photo or a JPG needs. The replacement is strongest at the exact color and fades toward the tolerance limit.
Preview matches paints every pixel the From color matches in magenta over the original, so you can see what will change before it does. Tune the color and tolerance until only the intended area is covered, then turn it off: the download is always the recolored image, never the preview.
Smooth edges blends the replacement into its surroundings over the chosen radius, so the boundary between changed and unchanged pixels is anti-aliased rather than stepped. A radius of 1 suits icons and logos; 2 to 4 suits photos. It changes only pixels next to a match, never the rest of the image.
No. Your browser decodes the file and does the pixel work with its Canvas API, and the page makes no request with it. You can load the page, go offline and keep working; the download is written from memory on your device.
No. The "Swap colors in an image" tool is free and opens without a sign-in, an account or an install.
Nothing. The "Swap colors in an image" tool holds your input in the page's memory, so closing or reloading the tab clears it, and it saves nothing in this browser.
Up to 100 MB per file, the limit the tool states under its drop area. A larger file is refused with a plain message instead of being decoded.
No, it takes one file at a time. If you drop or choose several, only the first is used; run the tool again for the next one.
The edit is written as a PNG because PNG stores every pixel exactly, with a full alpha channel, so the result can be edited again without a second round of loss.
No. The browser decodes the image and the tool writes a new file from its pixels, so camera EXIF, GPS position and text chunks in the original are not copied into the result. Keep the original file if you need them.
No. The result has the same width and height in pixels as the source.
Closest to the "Swap colors in an image" tool: PNG color replacer, Change a color in an image, JPG color swap, WebP icon color swap. Each opens on its own page, free and in the browser.
The "Swap colors in an image" tool is one of 47 in its group. The group's page, /tools/png, lists them all.
The tool is free. Its interface is built from shadcn.io's own components (Button, Input, Slider and the rest of the registry under /ui), which come in React, Vue, Svelte and Solid. Pro adds the blocks and templates for the product around it.
4.9 out of 5 from 150+ developers
Build the product around it
Every block, template and icon, installed by your AI agent in your theme. The tools stay free.
Get Pro





