Jump to content
You must now use your email address to sign in [click for more info] ×

What is the workflow to replace an EXACT color in an image?


Recommended Posts

The short version of my question is: I want to replace one color with an exact different color (e.g. specified by hexadecimal). I've tried 2 approaches but neither have worked so I thought I see what is the official/common way to replace with an exact color?  

 

My scenario:

I'm using Affinity Photo.  I have an image of a green jacket.

I want to make the green jacket (variations of 2B675A) an EXACT color of orange (variations of F26921).

If I use the Color Replacement Brush, it paints the jacket brown (not orange as I would like).  I get the Color Replacement Brush only paints hue (and not saturation or luminosity, so this may be working as designed).

Since the Color Replacement Brush didn't work, I tried the "create 2 rectangles and match their color" approach I found in a YouTube video (linked below), but that approach also did not work.  I got a brown-ish orange color, but no where near the orange I'm targeting.  I also tired every adjustment layer in Affinity Photo and was quite surprised that HSL, Levels, Recolor (or any of the brightness ones) couldn't get the rectangle to match the color of the other rectangle exactly.

So my question is, if the Color Replacement Brush and "matching rectangles" doesn't work, (and adjustments layers like HLS aren't exact enough), what is the workflow for replacing an exact color in Affinity Photo?  (and not just a single pixel of color swap out, the method needs to take into account many subtle variations of a color, like all the colors in a green jacket)

I also have Affinity Designer if that has a faster tool/workflow than Affinity Photo for this.

Thanks for any ideas-

 
Video on "matching rectangles" approach that didn't work for my colors:

 

Link to comment
Share on other sites

To change colours, I usually make a rectangle with the fill colour to what I want the result to be. Then set the layer blend mode to "Colour". Brightness needs to be adjusted separately (the green jacket needs to be adjusted to the brightness of the orange jacket). 

However, I don't know how to target (mask) the exact colour which is green 2B675A in your example. Perhaps make hue range mask and temporarily place an object with 2B675A to help dial in the mask on that colour.

Link to comment
Share on other sites

2 hours ago, PitterPen said:

If I use the Color Replacement Brush, it paints the jacket brown (not orange as I would like).  I get the Color Replacement Brush only paints hue (and not saturation or luminosity, so this may be working as designed).

Since brown is dark yellow/orange, can’t you simply lighten the result (and increase the saturation, if necessary)? :/

Alfred spacer.png
Affinity Designer/Photo/Publisher 2 for Windows • Windows 10 Home/Pro
Affinity Designer/Photo/Publisher 2 for iPad • iPadOS 17.4.1 (iPad 7th gen)

Link to comment
Share on other sites

2 hours ago, Alfred said:

Since brown is dark yellow/orange, can’t you simply lighten the result (and increase the saturation, if necessary)? :/

Interestingly, no, I'm not able to match the brown to the orange just by adjusting Luminosity and Saturation.  I can lighten the brown's Luminosity, but I can't increase the saturation enough.  Specifically, if I use the Info window, I see the orange has an Info value of 86% saturation.  I see the brown has an Info value 38% saturation.  If I apply an HSL adjustment and crank the saturation to increase the brown by 100%, it only goes to Info value 73% saturation (where as it needs to go up to Info value 86%, the orange's saturation level).  If I add 4 more HSL layers on top of that, all maxed out at adding 100% adjustment saturation, the brown's saturation tops out at Info value 76% (and won't go any higher, regardless of adding more HSL layers).

It seems odd that I can't add any more saturation to the brown to get it to match the orange.  In the Info window, the brown has the same Hue number and Luminosity number as the orange, but I can't get brown to the saturation level of the orange.  

It seems like color swapping was easy in Photoshop, so I'm probably missing something here.  This feels way harder than it should be.

Link to comment
Share on other sites

7 hours ago, PitterPen said:

 I got a brown-ish orange color, but no where near the orange I'm targeting.  I also tired every adjustment layer in Affinity Photo and was quite surprised that HSL, Levels, Recolor (or any of the brightness ones) couldn't get the rectangle to match the color of the other rectangle exactly.

How about this: Instead using an an adjustment layer, use a neutral gray layer between green and orange?
For instance 70% gray, 50% layer opacity, Normal blend mode. Depending on the contrast in the green (shadows/lights) different gray value might work better.

1756708875_greenorange.thumb.jpg.ec07158780c9b8bc817f24d1fbf55f68.jpg

 

macOS 10.14.6 | MacBookPro Retina 15" | Eizo 27" | Affinity V1

Link to comment
Share on other sites

I think this works

Proc Tex values

R+0.780392156862745

G+0.00784313725490193

B+-0.223529411764706

image.png.e4968c3fbbca68b5e87df20eb43757bf.png

Rectangles below are identical

image.jpeg.e4f205af56e918646a0a4950df932ab0.jpeg

 

And a spreadsheet to do the sums

FromColourToColour.xlsx

Microsoft Windows 11 Home, Intel i7-1360P 2.20 GHz, 32 GB RAM, 1TB SSD, Intel Iris Xe
Affinity Photo - 24/05/20, Affinity Publisher - 06/12/20, KTM Superduke - 27/09/10

Link to comment
Share on other sites

On 3/23/2023 at 8:58 AM, David in Яuislip said:

I think this works

Proc Tex values

R+0.780392156862745

G+0.00784313725490193

B+-0.223529411764706

 

Hummmm... interesting idea.  I didn't even know Procedural Textures were a thing in Affinity Photo.  I follow your logic, and it seems like it should work.  But when I apply a Proc Texture as a child layer to a green rectangle, nothing happens (the color doesn't change).  I'm likely doing something wrong as when I watch a tutorial video (linked below), all he does is enter 0 for R and the screen changes color instantly. I tired R = 0 and nothing happened to the green rectangle.   I also tried all blend modes (Normal, color, etc.) for the Proc Text and the rectangle and no luck.  Here's an image of my setup if anyone happens to see something off:

 

 

 

 

Link to comment
Share on other sites

51 minutes ago, PitterPen said:

I follow your logic, and it seems like it should work.

It certainly works in V1 as my image above shows
I used
R+0.780392156862745
G+0.00784313725490193
B+-0.223529411764706
Blend mode:Normal

You've used
+0.780392156862745
+0.00784313725490193
+-0.223529411764706
Blend mode:Color

Microsoft Windows 11 Home, Intel i7-1360P 2.20 GHz, 32 GB RAM, 1TB SSD, Intel Iris Xe
Affinity Photo - 24/05/20, Affinity Publisher - 06/12/20, KTM Superduke - 27/09/10

Link to comment
Share on other sites

3 hours ago, David in Яuislip said:

It certainly works in V1 as my image above shows
I used
R+0.780392156862745
G+0.00784313725490193
B+-0.223529411764706
Blend mode:Normal

You've used
+0.780392156862745
+0.00784313725490193
+-0.223529411764706
Blend mode:Color

No luck, I tried Normal mode and several other modes just to see, but I don't see any color changes.  Seems like I'm doing something wrong or there's a bug because I should at least see something if I change R = 0.

Link to comment
Share on other sites

4 hours ago, PitterPen said:

No luck, I tried Normal mode and several other modes just to see, but I don't see any color changes.  Seems like I'm doing something wrong or there's a bug because I should at least see something if I change R = 0.

Upload that test document to the forum

To save time I am currently using an automated AI to reply to some posts on this forum. If any of "my" posts are wrong or appear to be total b*ll*cks they are the ones generated by the AI. If correct they were probably mine. I apologise for any mistakes made by my AI - I'm sure it will improve with time.

Link to comment
Share on other sites

The method this person is using in the YouTube video you referred is pretty good. Check carefully what she does since if the adjustment group you create does not work properly, you may have some secondary issue with the mask, the layer kinds (do you have your bitmap to be colored on a Pixel layer?), etc.

Please check the attached .aphoto document to see how this kind of a color adjustment would work on a generated texture on a Pixel layer. I have made the coloring a bit darker to show clearly the texture but basically the coloring itself is accurate, different contexts just require a bit different level adjustment and (optional) adjustment of layer blend options.

colorchanger2.afphoto

change_exact_color.thumb.png.026d62bafa19af07dc79f7e233245cf0.png

Link to comment
Share on other sites

10 hours ago, PitterPen said:

Seems like I'm doing something wrong

Yep, your fields have numbers, mine have expressions which will modify the underlying pixels

ProcTexValuesError.png

Microsoft Windows 11 Home, Intel i7-1360P 2.20 GHz, 32 GB RAM, 1TB SSD, Intel Iris Xe
Affinity Photo - 24/05/20, Affinity Publisher - 06/12/20, KTM Superduke - 27/09/10

Link to comment
Share on other sites

On 3/24/2023 at 3:53 AM, David in Яuislip said:

Yep, your fields have numbers, mine have expressions which will modify the underlying pixels

ProcTexValuesError.png

Doh!  Sorry I didn't see that!  Thanks for clarifying. When I use the letters with the numbers, it works.

However, in practice, it doesn't really look how I want it too.  It's a bit too strong looking.  What I ended up liking more is to:

1.  Do an orange (the exact shade of orange) rectangle overlay with Blend = Color.

2.  Add another rectangle overlay, that's gray (H = 0, S = 0).  Set Blend = Luminosity (not Color), and adjust Luminosity and Opacity of the rectangle to taste.  <--I believe this is essentially what the other posters were suggesting but I wasn't able to understand what they meant until I played around with these ideas more. 

Thank you much to all the posters, this discussion was most helpful.

If the developers/admins read this, an idea for Affinity Photo V3 would be to add an X/Y grid slider to the Color Replacement Brush Tool (maybe under advanced so as not to confuse beginners).  The values for X and Y could be Luminosity and Saturation, where 100% X and Y (the upper right corner of the X/Y grid) is the exact color you are trying to match (matched in terms of H, S, and L).  That way you can dial in the match to taste when Hue isn't enough for matching.  I really like the Color Replacement Brush, but when the result is vastly different from the target (e.g. brown when I'm trying to match to orange), the tool feels lacking. 

Link to comment
Share on other sites

On 3/22/2023 at 4:09 PM, user_0815 said:

To change colours, I usually make a rectangle with the fill colour to what I want the result to be. Then set the layer blend mode to "Colour". Brightness needs to be adjusted separately (the green jacket needs to be adjusted to the brightness of the orange jacket). 

However, I don't know how to target (mask) the exact colour which is green 2B675A in your example. Perhaps make hue range mask and temporarily place an object with 2B675A to help dial in the mask on that colour.

I think I better understand now what you were saying.  I ended up using this kind of method of use the exactly color, then dial in brightness to taste.

Link to comment
Share on other sites

On 3/22/2023 at 5:17 PM, Alfred said:

Since brown is dark yellow/orange, can’t you simply lighten the result (and increase the saturation, if necessary)? :/

Yeah, I was afraid to do that because I wanted an exact match, but when the exact match didn't look that good that's what I ended up doing (lol)

Link to comment
Share on other sites

On 3/24/2023 at 1:32 AM, lacerto said:

The method this person is using in the YouTube video you referred is pretty good. Check carefully what she does since if the adjustment group you create does not work properly, you may have some secondary issue with the mask, the layer kinds (do you have your bitmap to be colored on a Pixel layer?), etc.

Please check the attached .aphoto document to see how this kind of a color adjustment would work on a generated texture on a Pixel layer. I have made the coloring a bit darker to show clearly the texture but basically the coloring itself is accurate, different contexts just require a bit different level adjustment and (optional) adjustment of layer blend options.

colorchanger2.afphoto

change_exact_color.thumb.png.026d62bafa19af07dc79f7e233245cf0.png

Thanks.  Your reply and others helped me see that each context takes some dialing in of the changes to taste.

Link to comment
Share on other sites

  • 3 months later...

One of the few things that I miss from Photoshop is its "Replace Color" adjustment. In Affinity Photo, I would love to be able to use + and - color pickers (with a fuzziness control) and change those picked colors to a specific HSL.

 

 

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.