Replace a color in a PNG.
Replace a color in a PNG and keep its alpha channel exactly as it was. Only the red, green and blue of matched pixels change; transparent edges, lossless quality and the image size stay the same.
Replace a color in a PNG.
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.
Drop the PNG
Drop the PNG; its transparency shows on the checkerboard and will be kept.
Pick the colors
Set From to the color to replace and To to the new one, by picker or hex code.
Keep the edges clean
Keep Smooth edges on at a small radius so anti-aliased edges carry the new color cleanly.
Download
Download the PNG, alpha channel untouched.
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.
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.
Yes, and it is the common case: drop the icon, set From to its color and To to the new one, and download. The edge pixels of an icon are partly transparent; their alpha stays as it was, so the icon sits on its background as cleanly as before.
No. PNG is lossless and the tool writes the pixels back without any lossy step, so the unmatched pixels are bit-for-bit the same. The output is a 32-bit PNG with an alpha channel; if the source was a palette PNG-8, the file may grow, and a PNG compressor brings it down again.
Only the first frame. Animated PNGs are decoded as their first frame by the browser, so the output is a still image. Extract the frames, recolor each and reassemble them in an animation tool.
PNG size depends on how well the rows compress, not on the dimensions alone, and the tool writes a 32-bit PNG with the browser's default compression. A compressor pass afterwards usually makes it smaller than the source.
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.
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.
With Keep shades on, each matched pixel takes the hue and saturation of the To color but keeps its own lightness, so a shaded red shirt becomes a shaded blue shirt instead of a flat blue cutout. Leave it off for flat graphics where every matched pixel should become exactly the new color.
One color at a time, with its tolerance. For a second color, download the result, drop it back in and pick the next From color; each pass builds on the last. Keep the original file so you can start over.
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 "Replace a color in a PNG" tool is free and opens without a sign-in, an account or an install.
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.
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 "Replace a color in a PNG" tool: PNG color replacer, Swap colors in an image, Replace a color in a JPG, Replace a color in a WebP image. Each opens on its own page, free and in the browser.
The "Replace a color in a PNG" 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





