🎨

Image Color Replacer

Replace a selected color using adjustable tolerance

40

Image Color Replacer — what it does

Replace one colour in an image with another, using a tolerance setting that decides how close a pixel must be to the source colour to be changed. Tolerance is the whole craft here: too low and only a fraction of a shaded area changes, too high and neighbouring colours get swept up with it.

Worked example

A 400 × 100 PNG with four flat status colours (red #DC2626, amber #F59E0B, green #16A34A, blue #2563EB). Source colour #dc2626, replacement #2563eb, run at two tolerance values; the cells are the colour read back from each block after Replace color.

ToleranceRed blockAmber blockGreen block
40#2563EB — replaced#F59E0B — kept#16A34A — kept
180#2563EB — replaced#2563EB — replaced too#16A34A — kept
40, source left at the default #ffffff#DC2626 — nothing changed#F59E0B#16A34A

Tolerance is the straight-line RGB distance to the source colour (slider 0–180; the farthest possible colour is about 441 away). Amber is about 126 from this red, so 180 sweeps it up while 40 does not. The download is color-replaced.png at 400 × 100.

When this tool helps

  • Recolouring a flat logo or icon to suit a different background or brand palette.
  • Changing a solid background colour behind a product shot without re-shooting it.
  • Adjusting a chart or diagram's colour scheme when only the exported image survives.

How to use it

  1. Choose the image.
  2. Set the source colour and the replacement colour.
  3. Adjust the tolerance until the preview looks right.
  4. Replace and download the PNG.

Accuracy, limits, and good practice

  • Flat graphics recolour cleanly; photographs have gradients and shadows, so a single replacement rarely covers the whole object convincingly.
  • Raise tolerance gradually — the point where it starts eating neighbouring colours is usually one step past where the target is fully covered.
  • Anti-aliased edges hold blended colours that fall outside tolerance, which is why a fine halo of the old colour can survive around shapes.

Frequently asked questions

Why is there a fringe of the old colour left?

Edge pixels are blends of the shape and its background. A slightly higher tolerance usually absorbs them, at some risk to nearby colours.

Can I replace several colours at once?

One pair per pass. Run the tool repeatedly, feeding each result back in, to recolour a multi-colour graphic.

Why is the output PNG?

PNG stores flat colour losslessly, so the replaced regions stay exactly the colour you chose rather than being smeared by compression.

How do I find the exact source colour?

The source box is a plain colour picker, not an eyedropper on the image. Read the value first with the image colour picker tool, paste it as the source and start with a low tolerance; the default source is white, which is why nothing changed in the last row.

What happens if I press Download before loading an image?

The status line shows "No file selected." and no file is downloaded. Replace color also does nothing until an image is loaded, and every run starts again from the original pixels, so raising the tolerance does not build on the previous result.

Related tools on this site

Everything above runs inside this page. Image Color Replacer needs no account, no upload, and no server round trip — close the tab and nothing is left behind.

圖片顏色替換能做什麼

把圖片中的某個顏色換成另一個,容差設定決定像素要多接近來源色才會被替換。容差正是這裡的手藝:太低只換掉帶陰影區域的一小部分,太高則會把鄰近顏色一起掃進去。

實際範例

一張 400 × 100、含四種純色狀態色(紅 #DC2626、琥珀 #F59E0B、綠 #16A34A、藍 #2563EB)的 PNG。來源色 #dc2626、替換色 #2563eb,以兩種容差各跑一次;儲存格是按下「替換顏色」後從每個色塊讀回的顏色。

容差紅色塊琥珀色塊綠色塊
40#2563EB——已替換#F59E0B——保留#16A34A——保留
180#2563EB——已替換#2563EB——也被替換#16A34A——保留
40,來源色維持預設的 #ffffff#DC2626——沒有任何改變#F59E0B#16A34A

容差是與來源色的 RGB 直線距離(滑桿 0 到 180;最遠的顏色距離約 441)。琥珀與這個紅相距約 126,所以 180 會把它一起換掉,40 則不會。下載檔為 400 × 100 的 color-replaced.png。

什麼時候用得上

  • 把平面商標或圖示改色,以配合不同背景或品牌配色。
  • 更換商品照後方的單色背景,不必重拍。
  • 只剩匯出圖檔時,調整圖表或示意圖的配色。

使用步驟

  1. 選擇圖片。
  2. 設定來源顏色與替換顏色。
  3. 調整容差,直到預覽正確。
  4. 執行替換並下載 PNG。

精確度、限制與實務建議

  • 平面圖形換色乾淨;照片有漸層與陰影,單次替換很少能說服力十足地覆蓋整個物件。
  • 容差請逐步調高——開始吃到鄰近顏色的那一格,通常就在剛好完全覆蓋目標的下一步。
  • 抗鋸齒邊緣是混合色、落在容差之外,這就是形狀周圍常殘留一圈舊色細邊的原因。

常見問題

為什麼還留著一圈舊顏色?

邊緣像素是形狀與背景的混色。把容差稍微調高通常能吸收它們,但會有波及鄰近色的風險。

可以一次換多個顏色嗎?

一次一組。把每次的結果再送回工具重跑,即可為多色圖形逐一換色。

為什麼輸出是 PNG?

PNG 無損儲存平面色彩,替換區域會保持你選定的顏色,不會被壓縮抹糊。

怎麼知道來源色的精確值?

來源色欄位只是一般的顏色選擇器,不是在圖片上取色的滴管。請先用圖片取色器讀出數值,貼進來源色,再從低容差開始;預設來源色是白色,這就是最後一列什麼都沒變的原因。

還沒載入圖片就按下載會怎樣?

狀態列會顯示「尚未選擇檔案。」,不會下載任何檔案。載入圖片前「替換顏色」也不會有動作;每次執行都從原始像素重新開始,所以調高容差不會疊加在上一次的結果上。

本站相關工具

以上步驟全部在這個頁面內完成,圖片顏色替換 不需要註冊、不上傳檔案、也不經過伺服器,關閉分頁後不會留下任何資料。