Jump to content

'Replace Colour' - How? (Affinity Photo)


Recommended Posts

Hi There,

 

I've just moved over to Affinity from Photoshop.

 

There is a 'Replace Colour' function in Photoshop that I use all the time. Basically selecting a colour and then altering the sliders to change. 

 

I cannot see this function anywhere in Affinity!

 

Can anyone help please

 

Thanks

 

 

Link to comment
Share on other sites

  • Staff

Hi cwmbrancon,

Welcome to Affinity Forums :)

Have you tried the Colour Replacement Brush Tool?

You can access it clicking on the arrow near the Paint Brush Tool icon (it will open a popup with more tools).

It's a little different from Photoshop: here you choose the colour you want to change to first then paint over the colour you want to replace in the canvas directly.

You can use the options in the context toolbar for more controls (tolerance etc).

Link to comment
Share on other sites

Hi MEB,

 

Thank you for your prompt response. I seem to have done everything correctly but still no luck.

 

I've selected (using the eyedropper) the colour I want to change - in this case grey. I have green as my main 'foreground' colour. I am using the brush to paint directly on the canvas, but nothing happens! 

 

Is there a instruction video / manual I can use for reference?

 

Many Thanks

Link to comment
Share on other sites

  • Staff

Hi cwmbrancon,

There's no need to use the eyedropper. Set the foreground colour to the replacement colour you want to use (from your example it would be green), then paint over the colour you want to replace on canvas. Make sure you are working with a Pixel layer (not an Image layer). You can check the type of layer you are working with looking at the label between parenthesis after the layer's name in the Layers panel. Affinity should change it automatically to a Pixel layer for you, if not right-click on the Layer and select Rasterise.

 

Since you are trying to "colorise" a grey area (a neutral color), the Colour Replacement Brush may not be the best option here since there's no colour information to be replaced with.

You may want to try to add an Adjustment instead (like the Recolour, Selective Colour or HSL Adjustements). It's also closer to what Photoshop does. The process is similar no matter the Adjustement chosen:

  • go to menu Layer ▸ New Adjustment Layer and select the apropriate adjustement.
  • select the new Adjustment layer in the Layers panel and press ⌘ (cmd) + I to invert the built-in mask (so you can paint over the areas you want to affect)
  • set the Paint Brush Colour to white and paint over the areas you want to adjust (you are actually painting on the mask)
  • use the Adjustment's window sliders to select / fine tune the colour of the painted areas.
Link to comment
Share on other sites

  • 1 month later...

Thanks for the topic, I am just trying to do this. The only thing I can't figure out is where to set the color that I want to replace.

 

For example:

If I wanted to change red to blue, how do I tell it that I want to replace red?

 

I've figured out how to make it blue, just not the red I want to replace, a mess of different other colors.

Link to comment
Share on other sites

  • Staff

If you're trying to colourise a grey area the easiest way is to use some brush work on a new pixel layer with an appropriate blend mode like Add or Screen (and a low-ish opacity). You could also use vector shapes with a fill colour. There are a couple of tutorials that would help with this:

 

Creative Painting

 

Colour toning with shapes

 

If you're replacing colours rather than adding them (for example blue to red), you can also try painting onto a new pixel layer with a Colour blend mode set. See the above videos for how to create these layers, set up your brush and blend mode, then experiment!

 

Hope that helps

Product Expert (Affinity Photo) & Product Expert Team Leader

@JamesR_Affinity for tutorial sneak peeks and more
Official Affinity Photo tutorials

Link to comment
Share on other sites

That's not quite what I was looking for. In the Help files for "Replacing Colours by Brush," there is a picture of cat in which they changed the color of the towel wrapped around it. What I'm trying to do (I'd upload a picture but I can't figure out how to add it to my media) is replace a washed out area on a face the was towards a sunny window. Maybe this is the wrong way to do it, but all I've been able to do is change the color of her lips, not what I actually want to change. Even if I try picking another color in the image that is very distinct, I can't seem to be able to change that either. Help?!! Thanks. Ooo. Just figured out the picture upload.

 

post-22155-0-95195200-1467640395_thumb.jpg

Link to comment
Share on other sites

  • 3 months later...
  • 8 months later...

Hi There,

 

I've just moved over to Affinity from Photoshop.

 

There is a 'Replace Colour' function in Photoshop that I use all the time. Basically selecting a colour and then altering the sliders to change. 

 

I cannot see this function anywhere in Affinity!

 

Can anyone help please

 

Thanks

Ok so messing around a bit I added a pixel layer then painted it all black, then selected contrast negate and that seemed to work for what i was doing.  Photoshops tool for color replace wasn't working, seems adobe isn't fixing their software so I'm running a trial of this.

Link to comment
Share on other sites

  • 1 year later...

A little late, but for anyone who's wondering:

  1. select -> Select Sampled Color
  2. Hit okay
  3. Press crl + u to open up HSL panel.
  4. Adjust colors as you wish. 

This is the closest alternative to "replace color" filter in Photoshop that I've found. The color replacement brush tool is cool and all, but in no way equal to "replace color." I'm not sure that Affinity photo has a replace color filter, sadly. These steps work though; only takes a couple of seconds more.

Link to comment
Share on other sites

  • 3 months later...
22 minutes ago, FitzRaymond said:

HuniSenpai: 

I got your solution to work once for me. But then, when I wanted to change a different color, and I click "Select sampled color," it keeps selecting the same color, the one i just changed. How do I get it to select a different color?

After you do crl + u and set the color to whatever you want, Affinity Photo creates a new layer for the HSL adjustment (crl + u is just a shortcut for color adjustment, aka Hue Saturation Lightness). That's cool because it allows you to disable that adjustment layer if you decide that you don't like the effect. But you need to make sure you don't have that adjustment layer selected when you try to do "select sampled color." So, in the layers panel, make sure to select the "Background" layer before doing "select sampled color" (or, at least usually, it is the "Background" layer that you want when doing photo editing). Let me know if this works :)! 

Link to comment
Share on other sites

  • 3 weeks later...
11 hours ago, warlordzico said:

I have the same problem. Once I select a sampled colour. I cann't select a different colour anymore. Even after restarting Affinity Photo ( Beta )

In the layers panel, make sure to re-select the background layer before doing "select sampled color" again, as I said in my previous post. Here's a walk through I just made for you

 

Let me know if this works for you :)! 

Link to comment
Share on other sites

  • 4 weeks later...

I'm trying to recolour UI, so I have flat colours on plain white backgrounds, that I need to replace with another specific colour to match my client's brand. How do I do that? When I try using the colour replacement brush, the colour that actually gets painted onto the canvas isn't the same shade as the specific RGB Hex value I've entered in the Colour studio. When I try using an HSL adjustment, the colour change is relative to the existing colour - I don't seem to be able to set the new colour as the specific colour I want.

How do I change to a specific colour?

Link to comment
Share on other sites

6 hours ago, somnolentsurfer said:

I'm trying to recolour UI, so I have flat colours on plain white backgrounds, that I need to replace with another specific colour to match my client's brand. How do I do that? When I try using the colour replacement brush, the colour that actually gets painted onto the canvas isn't the same shade as the specific RGB Hex value I've entered in the Colour studio. When I try using an HSL adjustment, the colour change is relative to the existing colour - I don't seem to be able to set the new colour as the specific colour I want.

How do I change to a specific colour?

Hey! 

The way that I would do it it (when a specific color needs to be forcefully set) is by just painting the color in by hand. You could also make a selection first if you want more precise control. Here's how to do that (and if you want to make a selection first, do that in-between steps 1 and 2 [make sure to play around w/ refine edge]):

  1. First, select the color you want in the color panel. So, this would be the specific hexadecimal RGB value that they gave you; just paste that thing into the #: field of the color selection window.
  2. Second, make a new layer. Set that layer to "hue".
  3. Thirdly, grab a brush [press b] and set it up the way you want. Then get painting on that new layer, making sure to be painting with the color you want.

Since it's a UI and you may want more control, make a selection with the rectangular marquee tool before doing shift + f5 to fill or using your paint brush. If it's a more complicated shape, maybe use something like the polygon lasso tool. 

Using the color replacement brush tool may not be powerful enough in your situation, so that's why I offer this alternative. Let me know how it goes :)! 

Link to comment
Share on other sites

Thanks. But using a simple brush and a selection gives me a harsh boundary between the colour and the white background, losing the anti-aliasing on the diagonal lines. I want the flat colour to be replaced with my specified hex, and the lighter tones around the edges to be with my colour lightened by an identical amount. Annoyingly, the Colour Replacement Brush seems to get that part right, it just doesn't replace with my colour!

When you say 'set that layer to "hue", do you mean blend mode? If I create a new layer with a Hue blend mode, then paint on that in my client's colour, the edges are correctly drawn in the right matching lighter shades, but again, with the blend mode on, the colour that's actually visible isn't the colour I pasted in, but a blended version of it.

Link to comment
Share on other sites

I've found this thread, which I think explains why the Colour Replacement Brush isn't working for me: it actually only replaces hue, and not colour. I guess that's also why it does preserve the lightness as desired at the edges of the shape.

Which means, I guess what I want is a tool that replaces hue, saturation and lightness at the point of the initial mouse click, then preserves the relative lightness as I move the brush about. Is there anything that does something like that?

Link to comment
Share on other sites

2 hours ago, somnolentsurfer said:

Thanks. But using a simple brush and a selection gives me a harsh boundary between the colour and the white background, losing the anti-aliasing on the diagonal lines. I want the flat colour to be replaced with my specified hex, and the lighter tones around the edges to be with my colour lightened by an identical amount.

Does it help if you feather your selection? That should result in the edges being a blend between your chosen color and the color just outside the selection, depending on the amount of feathering you choose.

-- Walt
Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases
PC:
    Desktop:  Windows 11 Pro 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 

    Laptop:  Windows 11 Pro 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
    Laptop 2: Windows 11 Pro 24H2,  16GB memory, Snapdragon(R) X Elite - X1E80100 - Qualcomm(R) Oryon(TM) 12 Core CPU 4.01 GHz, Qualcomm(R) Adreno(TM) X1-85 GPU
iPad:  iPad Pro M1, 12.9": iPadOS 18.1, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sequoia 15.0.1

Link to comment
Share on other sites

 

4 hours ago, somnolentsurfer said:

Thanks. But using a simple brush and a selection gives me a harsh boundary between the colour and the white background, losing the anti-aliasing on the diagonal lines. I want the flat colour to be replaced with my specified hex, and the lighter tones around the edges to be with my colour lightened by an identical amount. Annoyingly, the Colour Replacement Brush seems to get that part right, it just doesn't replace with my colour!

When you say 'set that layer to "hue", do you mean blend mode? If I create a new layer with a Hue blend mode, then paint on that in my client's colour, the edges are correctly drawn in the right matching lighter shades, but again, with the blend mode on, the colour that's actually visible isn't the colour I pasted in, but a blended version of it.

 

4 hours ago, somnolentsurfer said:

I've found this thread, which I think explains why the Colour Replacement Brush isn't working for me: it actually only replaces hue, and not colour. I guess that's also why it does preserve the lightness as desired at the edges of the shape.

Which means, I guess what I want is a tool that replaces hue, saturation and lightness at the point of the initial mouse click, then preserves the relative lightness as I move the brush about. Is there anything that does something like that?

Try using a feather or refine edge.I think you may want to do feather in your case since it's a UI design; use a small feather, like 2px. I assume the problem that your getting (since this is a UI design) is that your cubes and boxes and whatnot have anti-aliasing, which kind of blurs the edges.  So maybe try to include those blurry bits in your selection, too. 

 

Are you using flow 100% and opacity 100% on your brush when your painting it in on the layer with the hue blend mode? The hue should change perfectly to whatever color your using. 

 

But yes, this method does not change the lightness; it only really changes the hue. If you wanted to change lightness, too, then make a selection and just start painting, no layer blend mode or anything. Or just use shift + f5 to fill instead of having to use the paint brush. The trick is that your selection has to be really good in that it is softer around the aliased areas by just the right amount. This is really difficult to achieve... you need to find just the right feather amount.

 

Photoshop's "Replace Color" dialogue would solve all of your issues; it makes the "feathered" selection that you need and then can force the color replacement as you wish. Affinity Photo really needs to add this tool: 

Image result for photoshop replace color dialogue

 

You can click on that "result" and it pops up with a color dialogue, where you can paste in your hexadecimal. Affinity Photo does not have "Replace Color" and, as far as I know, neither Photoshop nor Affinity Photo have a brush-tool that preserves lightness like you described. Affinity Photo and Photoshop both have their positives and negatives. One of Affinity Photo's huge negatives (for me and, evidently, for you too) is that they failed to add in the darn "Replace Color" tool. As a product photographer, I really need this Replace Color tool for setting parts of products to particular colors. Hopefully it gets to the devs of Affinity Photo that they really really should add this feature. 

Link to comment
Share on other sites

Thanks a lot. But what I was really hoping to avoid was all the tedious faffing about adjusting feather by eye with lots of trial and error. I've eventually managed to achieve it with the following steps:

  1. Add a black and white adjustment, and tweak that until the main colour appears 100% black, and the edge tones have changed as little as possible.
  2. Merge the adjustment layer with the layer I'm trying to edit.
  3. Create a new layer, filled with white.
  4. Hide the new layer, and with the original layer selected, examine the individual red, green, and blue channels in the channels studio to find one that looks as close as possible to identical to the black and white image (I think I used 'Composite Green').
  5. Right click that channel and choose 'Load To Pixel Selection'.
  6. In the Select menu choose 'Invert Pixel Selection'.
  7. Reactivate the white layer created in step three and, with that selected, flood fill the selection with the desired colour.

So, still some judging by eye, but at least I could see what I was doing adjusting the black tones, rather than not knowing what I had until after filling the selection, as would have been the case using feather.

Guess the next stop is the roadmap/feature request forums to see if they already have a replace colour feature on the list!

Link to comment
Share on other sites

  • 4 months later...

Thanks for highlighting these steps.

Original image:

1131051817_ClipartFish13754.jpg.9bb0a302c5f4a1d2ff6c4259ed5c0ca0.jpg

 

Just the Orange part of the fish.

2053465948_ClipartFish13754-Orange.png.4a582eb96bfc882b1999e9e31353cd8c.png

 

and of course, I can have just the black outline of the original or just the white background.

Very helpful. Thanks guys.

 

 

iPad Mini 6.  256GB. My GoTo design platform.

M2 Mac Mini. 24GB. LG 4K Monitor. + Samsung Monitor 2.

Windows 10 Toshiba. Windows 11 Parallels on Mac.

Publisher. Designer. Photo for Mac, PC & iOS. FCP, DaVinci, CapCut, Luma Fusion. etc.

@Affinity-Inspiration on YouTube.

 

Link to comment
Share on other sites

  • 8 months later...
2 hours ago, sumneuron said:

Hi I just want to state that while the color replacement brush works fine when one doesn't want to mask and recolor certain parts, I would still very much like to have just an easy way to say take this rgb / hex value and make it this other one everywhere. Please make this a feature.

What you are looking for there is a search/replace on one hex or rgb value. Like [search for #FF0000 and replace with #FF6347]. 

It probably could be done, but why would you I wonder? Perhaps you need ffmpeg to try that.?

for example

 

for example

https://video.stackexchange.com/questions/19631/ffmpeg-how-to-replace-video-background-color-with-transparency-while-capturi

Edited by HarryMcGovern
edited

 

iPad Mini 6.  256GB. My GoTo design platform.

M2 Mac Mini. 24GB. LG 4K Monitor. + Samsung Monitor 2.

Windows 10 Toshiba. Windows 11 Parallels on Mac.

Publisher. Designer. Photo for Mac, PC & iOS. FCP, DaVinci, CapCut, Luma Fusion. etc.

@Affinity-Inspiration on YouTube.

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.