Image Color Changer: 6 Ways to Shift Colors in Photos
You have a product photo with a blue shirt, and the client wants it in red. A brand mockup uses last season's green, and the new palette calls for teal. A social media template needs its accent color changed for a different campaign. These are all the same problem: shifting colors in an existing image without redrawing anything.
Color changing works by manipulating hue, saturation, and lightness values — either globally (the entire image shifts) or selectively (only a target color range moves). The distinction matters. A global hue shift turns everything bluer. A selective color replacement turns only the red elements blue, leaving everything else untouched.
This article covers both approaches across six tools. If you need to change just the background color, see our background color change guide. If you need precise color swapping (exact hex-to-hex replacement), a dedicated replace-color guide is coming soon.
Quick Reference: Method Comparison
| Method | Best For | Selective Color | Batch Support | Cost | Platform |
|---|---|---|---|---|---|
| Photoshop v26.3 | Precise selective edits | Yes (Color Range) | Via Actions | $22.99/mo | Win/Mac |
| GIMP v2.10.38 | Free selective editing | Yes (Color Rotate) | Script-Fu | Free (GPL) | Win/Mac/Linux |
| ImageMagick v7.1.1 | CLI batch processing | Limited | Yes | Free (Apache 2.0) | All |
| Python Pillow 10.4 | Scripted automation | Yes (with code) | Yes | Free (MIT) | All |
| CSS hue-rotate() | Live web previews | No (global only) | N/A | Free | Browser |
| Mobile (Snapseed/PicsArt) | Quick phone edits | Yes | No | Free/Freemium | iOS/Android |
Try it yourself
Reduce file size without visible quality loss — free, instant, no signup. Your images never leave your browser.
Photoshop v26.3: Hue/Saturation + Color Range
Photoshop gives you the most control over selective color changes. Two features do the heavy lifting: Hue/Saturation adjustment layers and Color Range selections.
Global Hue Shift
- Open your image in Photoshop v26.3.
- Go to Layer > New Adjustment Layer > Hue/Saturation.
- Drag the Hue slider left or right. The entire image shifts along the color wheel — a +60 shift turns reds into yellows, greens into cyans, and so on.
- Adjust Saturation (intensity) and Lightness as needed.
This works when you want the whole image to take on a different color cast. Think mood changes, color grading, or creating alternate product colorways from a flat-lay shot.
Selective Color Replacement
For changing only specific colors (a red car, a blue logo) while leaving everything else alone:
- Go to Select > Color Range.
- Click the color you want to change in the image. Adjust Fuzziness (tolerance) until the selection preview captures the full area. A fuzziness of 40-80 works for most solid-color objects.
- Click OK to load the selection.
- Add a Hue/Saturation adjustment layer. The selection automatically becomes the layer mask.
- Drag the Hue slider to your target color. Only the selected region changes.
The mask is editable — paint with black to exclude areas, white to include them. This is the gold standard for "change the shirt from blue to red" tasks because it handles gradients, shadows, and highlights within the selected color range.
Pro tip: For objects with complex edges (hair, fur, fabric folds), use Select > Color Range with the Localized Color Clusters checkbox enabled. This restricts the selection to a spatial region, preventing distant same-colored objects from being included.
GIMP v2.10.38: Hue-Saturation + Color Rotate
GIMP offers two paths to color changes: a straightforward Hue-Saturation tool and a more powerful Color Rotate filter.
Hue-Saturation Adjustment
- Open your image in GIMP v2.10.38.
- Go to Colors > Hue-Saturation.
- Choose Master for a global shift, or select a specific primary color range (R, Y, G, C, B, M) to target.
- Drag the Hue slider. Each primary range is independent — you can shift reds without touching blues.
- Adjust Lightness and Saturation to fine-tune.
The primary color ranges overlap slightly, which is actually useful — it creates smoother transitions than a hard cutoff. For most simple color shifts (make the green leaves more yellow, push the sky from cyan to deeper blue), this is faster than Photoshop.
Color Rotate (Selective Replacement)
For mapping one color range to another:
- Go to Colors > Map > Color Rotate.
- Set the Source color range by dragging the "From" and "To" arrows on the color wheel. This defines which colors in the image will be affected.
- Set the Destination range the same way. Source colors get mapped to destination colors.
- Toggle Clockwise or Counter-clockwise to control the mapping direction around the color wheel.
- Click OK to apply.
Color Rotate is selective by design — only pixels within the source range change. It is particularly effective for recoloring flat illustrations, logos, and graphics where colors are well-separated.
Batch via Script-Fu: GIMP v2.10.38 supports Script-Fu for automation. A basic batch hue shift:
; GIMP v2.10.38 Script-Fu — batch hue shift
(let* (
(image (car (gimp-file-load RUN-NONINTERACTIVE "input.png" "input.png")))
(drawable (car (gimp-image-get-active-drawable image)))
)
(gimp-drawable-hue-saturation drawable HUE-RANGE-ALL 90 0 0 0)
(file-png-save RUN-NONINTERACTIVE image drawable "output.png" "output.png" 0 9 1 1 1 1 1)
(gimp-image-delete image)
)
Run it from the command line:
gimp -i -b '(script-fu-console-get-filter-obsolete)' -b '(gimp-quit 0)'
ImageMagick v7.1.1: -modulate and -fx
ImageMagick handles color shifts from the command line, which makes it the go-to for batch processing. The -modulate flag controls brightness, saturation, and hue as percentages.
Global Hue Shift with -modulate
# ImageMagick v7.1.1 — shift hue by 60 degrees
magick input.png -modulate 100,100,133 output.png
The three -modulate values are brightness, saturation, hue — each as a percentage of the original. Hue 100 means no change. The hue value maps to degrees: 100 = 0 degrees, 133 = +60 degrees, 166 = +120 degrees, 200 = +180 degrees. The formula is 100 + (degrees * 100 / 180).
Common shifts:
| Desired Shift | -modulate Value | Effect |
|---|---|---|
| +30 degrees | 100,100,117 | Subtle warm-to-cool shift |
| +60 degrees | 100,100,133 | Red becomes yellow, blue becomes magenta |
| +90 degrees | 100,100,150 | Red becomes green, blue becomes red |
| +180 degrees | 100,100,200 | Full inversion of hues (complementary colors) |
Selective Color Replacement with -fx
For targeting specific hues, use the -fx operator. This example shifts only red tones (hue 0-30 degrees) to blue:
# ImageMagick v7.1.1 — shift red pixels to blue
magick input.png -colorspace HSL -channel R \
-fx "u > 0.0 && u < 0.083 ? u + 0.333 : u" \
-colorspace sRGB output.png
The -fx operator works in normalized values (0-1 for the full hue range). Hue 0.0-0.083 covers reds (0-30 degrees). Adding 0.333 shifts them by 120 degrees — red to blue.
Batch Processing
Process an entire folder:
# ImageMagick v7.1.1 — batch hue shift all PNGs in a directory
for f in input_dir/*.png; do
magick "$f" -modulate 100,100,133 "output_dir/$(basename "$f")"
done
After batch processing, you may need to convert formats or resize the results for your target platform.
Python Pillow 10.4: Programmatic Color Shifts
Python gives you pixel-level control. Pillow (PIL Fork) v10.4 handles the image I/O, and you write the color logic.
Global Hue Rotation
# Python 3.12 + Pillow 10.4.0
from PIL import Image
import colorsys
def shift_hue(image_path, degrees, output_path):
"""Shift all hues in an image by the specified degrees."""
img = Image.open(image_path).convert("RGB")
pixels = img.load()
shift = degrees / 360.0
for y in range(img.height):
for x in range(img.width):
r, g, b = pixels[x, y]
h, s, v = colorsys.rgb_to_hsv(r / 255.0, g / 255.0, b / 255.0)
h = (h + shift) % 1.0
r2, g2, b2 = colorsys.hsv_to_rgb(h, s, v)
pixels[x, y] = (int(r2 * 255), int(g2 * 255), int(b2 * 255))
img.save(output_path)
shift_hue("product.png", 60, "product_recolored.png")
This is slow for large images because it iterates pixel by pixel. For better performance, use NumPy:
Fast Hue Shift with NumPy
# Python 3.12 + Pillow 10.4.0 + NumPy 2.1.0
from PIL import Image
import numpy as np
import colorsys
def shift_hue_fast(image_path, degrees, output_path):
"""Fast hue shift using NumPy vectorization."""
img = Image.open(image_path).convert("RGB")
arr = np.array(img, dtype=np.float64) / 255.0
# Convert RGB to HSV using vectorized operations
r, g, b = arr[:, :, 0], arr[:, :, 1], arr[:, :, 2]
maxc = np.maximum(r, np.maximum(g, b))
minc = np.minimum(r, np.minimum(g, b))
diff = maxc - minc
# Hue calculation
h = np.zeros_like(maxc)
mask = diff > 0
rm = mask & (maxc == r)
gm = mask & (maxc == g) & ~rm
bm = mask & ~rm & ~gm
h[rm] = ((g[rm] - b[rm]) / diff[rm]) % 6
h[gm] = ((b[gm] - r[gm]) / diff[gm]) + 2
h[bm] = ((r[bm] - g[bm]) / diff[bm]) + 4
h = h / 6.0
s = np.where(maxc > 0, diff / maxc, 0)
v = maxc
# Apply hue shift
h = (h + degrees / 360.0) % 1.0
# Convert HSV back to RGB
hi = (h * 6).astype(int) % 6
f = h * 6 - hi
p = v * (1 - s)
q = v * (1 - f * s)
t = v * (1 - (1 - f) * s)
out = np.zeros_like(arr)
for i, (rv, gv, bv) in enumerate(
[(v, t, p), (q, v, p), (p, v, t), (p, q, v), (t, p, v), (v, p, q)]
):
m = hi == i
out[:, :, 0][m] = rv[m]
out[:, :, 1][m] = gv[m]
out[:, :, 2][m] = bv[m]
result = Image.fromarray((out * 255).astype(np.uint8))
result.save(output_path)
shift_hue_fast("product.png", 90, "product_shifted.png")
Selective Color Replacement
Target a specific hue range and remap only those pixels:
# Python 3.12 + Pillow 10.4.0 + NumPy 2.1.0
from PIL import Image
import numpy as np
def replace_color_range(image_path, source_hue, target_hue, tolerance, output_path):
"""Replace pixels near source_hue with target_hue. Hues in degrees (0-360)."""
img = Image.open(image_path).convert("RGB")
hsv = img.convert("HSV")
arr = np.array(hsv)
# Pillow HSV: H is 0-255 (mapping to 0-360 degrees)
h_channel = arr[:, :, 0].astype(np.float64)
src = source_hue * 255 / 360
tgt = target_hue * 255 / 360
tol = tolerance * 255 / 360
# Find pixels within tolerance of source hue
diff = np.minimum(np.abs(h_channel - src), 255 - np.abs(h_channel - src))
mask = diff <= tol
# Shift matching pixels
shift = tgt - src
arr[:, :, 0][mask] = ((h_channel[mask] + shift) % 255).astype(np.uint8)
result = Image.fromarray(arr, "HSV").convert("RGB")
result.save(output_path)
# Shift red (hue ~0) to blue (hue ~240), with 30-degree tolerance
replace_color_range("input.png", 0, 240, 30, "output.png")
This approach lets you build recoloring into automated pipelines — CI/CD asset generation, e-commerce variant creation, or dynamic theme generation.
CSS hue-rotate(): Browser-Side Color Shifts
Need a color shift for a web page without editing the source image? CSS hue-rotate() applies in real time:
/* Shift all colors by 90 degrees */
.recolored {
filter: hue-rotate(90deg);
}
/* Combine with other filters */
.vintage-warm {
filter: hue-rotate(15deg) saturate(1.2) brightness(1.05);
}
<img src="product.png" class="recolored" alt="Product in alternate color">
Previewing Multiple Colorways
CSS hue-rotate() is perfect for showing product color variants without generating separate images:
.color-original { filter: none; }
.color-warm { filter: hue-rotate(30deg); }
.color-cool { filter: hue-rotate(180deg); }
.color-accent { filter: hue-rotate(270deg) saturate(1.3); }
The trade-off: hue-rotate() is global — it shifts every color in the image equally. A product on a colored background will have both the product and background shift. For production-quality images, edit the source file. For previews, prototyping, and interactive galleries, CSS is hard to beat.
This pairs well with Pixotter's browser-based pipeline. Upload your image, convert it to the optimal format for web delivery, then apply CSS filters for client-side variations.
Mobile Apps: Snapseed and PicsArt
For quick edits on your phone, two apps handle color changes well.
Snapseed v2.21 (Free, iOS/Android)
- Open the image and tap Tools > Tune Image for global adjustments.
- For selective color: tap Tools > Selective and place a control point on the color you want to change.
- Pinch to adjust the selection radius. Swipe up/down to choose Brightness, Contrast, Saturation, or Structure. Swipe left/right to adjust.
- Snapseed does not have a direct hue slider in Selective mode. For hue shifts, use Tools > White Balance to push the overall color temperature, or use Tune Image > Warmth/Saturation for broader shifts.
Snapseed is strongest for subtle color grading and localized adjustments. For dramatic hue changes, the desktop tools are more capable.
PicsArt v24.9 (Freemium, iOS/Android)
- Open the image and tap Effects > Colors.
- Choose Color Replace — tap the color you want to change, then drag the Replace Hue slider to your target color.
- Adjust Range to control how much of the original color gets caught in the selection.
PicsArt's Color Replace is genuinely useful for the "change shirt color" use case on mobile. The selection algorithm handles gradients reasonably well for a phone app. The free tier includes this feature, though you will see ads.
Choosing the Right Method
The best tool depends on your volume and precision needs:
- One-off selective change (red shirt to blue): Photoshop v26.3 or GIMP v2.10.38. The mask-based workflow handles complex edges.
- Batch global shift (recolor 200 product images): ImageMagick v7.1.1 or Python Pillow 10.4. Script it once, run it forever.
- Web preview (show product color options): CSS
hue-rotate(). Zero image processing, instant results. - Quick mobile edit (recolor for social post): PicsArt v24.9 Color Replace.
- Automated pipeline (CI/CD, e-commerce variant generation): Python Pillow 10.4 with NumPy for speed.
For related techniques, check our guide on inverting image colors (full-spectrum inversion rather than selective shifts), the CMYK to RGB converter guide for handling print-to-digital color conversion, and our color picker tool guide to extract exact color values from any image before you start shifting.
Understanding RGB vs CMYK color spaces also helps when the color shift needs to stay within a printable gamut.
For a detailed guide on changing eye color specifically, see change eye color in photo.
FAQ
What is the difference between hue shift and color replacement?
A hue shift rotates all colors in the image by the same number of degrees on the color wheel. Everything changes — reds, blues, greens, and neutrals all move together. Color replacement targets a specific color range and changes only those pixels. Use hue shift for mood/tone changes, color replacement for "change the red car to blue."
Can I change one specific color without affecting the rest of the image?
Yes. In Photoshop v26.3, use Select > Color Range to isolate the target color, then apply Hue/Saturation to only the selection. In GIMP v2.10.38, Color Rotate maps a source hue range to a destination range. In Python Pillow 10.4, filter pixels by hue value before applying the shift. PicsArt v24.9 on mobile has a built-in Color Replace tool for this.
Will changing colors reduce image quality?
Each round of color manipulation introduces minor rounding errors in pixel values. A single hue shift is virtually lossless. Stacking 10+ adjustments on a JPEG can produce visible banding — always work from the original file and apply changes in one step when possible. Save final results in PNG or WebP to avoid additional JPEG compression artifacts. Use Pixotter to convert between formats without quality loss.
How do I match a specific brand color (hex or Pantone)?
Hue sliders work in degrees, not hex values. To match an exact target: convert your target hex to HSL, convert your source color to HSL, and calculate the degree difference. Apply that difference as your hue shift. In Photoshop v26.3, the Colorize option in Hue/Saturation lets you force the entire selection to a single hue value — useful for exact brand color matching.
Does CSS hue-rotate() work on all browsers?
CSS filter: hue-rotate() has over 97% browser support as of 2026, including Chrome 119+, Firefox 121+, Safari 17+, and Edge 119+. It does not work in Internet Explorer (which is end-of-life). Performance is excellent for static images. For animated hue rotations, test on target devices — mobile GPUs handle it well, but very large images may cause frame drops.
Can I batch-change colors in hundreds of images?
ImageMagick v7.1.1 and Python Pillow 10.4 both handle batch processing. ImageMagick is fastest for simple global hue shifts using a shell loop with -modulate. Python is better when you need selective color targeting per image or when the logic varies between files. For batch jobs, also consider whether you need to resize images to consistent dimensions as part of the same pipeline.
What happens to shadows and highlights when I change colors?
Good color-change tools work in HSL or HSV space, which separates hue from lightness. When you shift the hue, shadows stay dark and highlights stay bright — only the color changes. This is why Hue/Saturation adjustments look natural while naive RGB channel swaps often look wrong. Shadows and highlights contain important color variation that makes objects look three-dimensional.
How is this different from changing the background color?
Changing the image color shifts the hue/saturation of objects within the image — a red dress becomes blue, a green logo becomes orange. Changing the background color involves removing the existing background and replacing it with a new solid or gradient fill. Different technique, different tools. We cover background replacement in our change image background color guide.
Try it yourself
Resize to exact dimensions for any platform — free, instant, no signup. Your images never leave your browser.