What's new
Photoshop Gurus Forum

Welcome to Photoshop Gurus forum. Register a free account today to become a member! It's completely free. Once signed in, you'll enjoy an ad-free experience and be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Gradient Map - from image


revnart

Power User
Messages
362
Likes
327
Hi, any of you know an automatic way of creating gradient/gradient map from image or even better: from layer or selection?
I really often need to change a colours of products for one of my clients, using different tools, hue and saturation+curves+ other tools but sometimes it just doesn't look exactly as I want, it such situation I grab gradient map and sample dark / mid / and highlights and create gradient map from other product with colours I need - this almost always give me results I need. But as I asked before is there a tool/software/script or just anything which can make gradient automatically?

Thanks for your help :)
 

Tom Mann

Guru
Messages
7,223
Likes
4,343
For years, I've wanted the same thing, revnart, but haven't been able to find anything that really works.

One (sorta-kinda) approach is to use a "match colors" type of approach. For example, this guy:
http://foksmarx.com/
https://www.ephotozine.com/article/foksmarx-recolorst-and-recolorle-photoshop-plug-ins-9394

came up with his RecolorST plugin. It works somewhat better than PS's native "match colors", BUT, IMHO, it still doesn't come close to what I would really like, nor does it give you the direct adjustment that you get with PS's native, straightforward, do-it-yourself GradientMap tool.

Another technique is to make yourself a little library of Gradient Maps. I've done this to colorize the skin tones in old B&W photos, and it works fairly well ... at least it gives one a few decent starting points.

Sorry I can't be more encouraging. If you find something, let me know, LOL.

Tom M
 

revnart

Power User
Messages
362
Likes
327
Thank you for your response Tom ;-) I guess we are not alone in our wish to have such tool.

Thank you for the link, I will look into it ;-)

Unfortunately I need completely new gradient map each time so even huge library of gradient maps doesn't help :)

If I find something I will share it for sure.
 

thebestcpu

Guru
Messages
2,988
Likes
2,747
What you request may be possible yet using a gradient map by itself to color mapping has built in issues.

The gradient map will take a specific gray tone in the image (calculated gray tone from the RGB numbers) and convert it to a specific RGB alternative.

The major issue of that is that many colors can map to the same gray tone and a gradient map would turn all of those different colors to a single output color.

So using the gradient map for this purpose is more limited in capability that most might think.

Just my opinion of course.
 

revnart

Power User
Messages
362
Likes
327
I am aware of that. I made an example of color to grayscale conversion, I hope It will be attached to the post.
In the example clearly you can see that only hues doesn't affect conversion.
I mostly change the hues but of course not only them.

Do you have any solution in mind?
 

revnart

Power User
Messages
362
Likes
327
Somehow no matter what I do, I can't attach anything from my phone. I will post it when I get to the office.

Edit: here goes the attachment:
gradient_mapping.jpg
 
Last edited:

thebestcpu

Guru
Messages
2,988
Likes
2,747
Hi Revnart
It is pretty clear to me from your example that I am not familiar enough with your technique to be helpful. I am quite familiar with the independent components of Luminance, Sat, and Hue yet not when a full band of a color spectrum comes our as pure gray.

Given that your original question was just automating a technique that is working well for you, and that I don't understand your workflow, I cannot answer your question about automation either.

So my conclusion, I am being a distraction to your primary goal/post and maybe another forum member can step in with some more focused recommendations.

Your approach sounds interesting so I may have something to learn and will monitor the thread. Sorry for the distraction.
 

SCTRWD

Power User
Messages
457
Likes
239
I know of only one way to do this. It's making Color Table file from your image and then applying it to target image in Index mode.

It works if you can live with 256 levels of gradient.

Long time ago PS could use Color Table files for Curves which could be used to make your custom gradient. This way you could effectively make Gradient map effect long before it was introduced in PS.
Now PS uses true float values for Color stops and Midpoints in the gradient and doesn't let you use Color Table files in the Curves or Gradient settings at all.
 
Last edited:

revnart

Power User
Messages
362
Likes
327
SCTRWD, can you explain a little more about part with color tables, how to do it? I'm really curious :)

thebestcpu - Maybe my last post was confusing, it was just an example so we can talk about it. It wasn't part of my workflow ;-)
 

SCTRWD

Power User
Messages
457
Likes
239
OK, forget about Color Tables:). We'll do it with Curves layer:

Open your source image. Let's assume it has a vertical gradient like on the images you posted. Now go to Image->Image Size... Set Constrain Proportions off, Width - 1 px, Height - 256 px, Resample method - Bicubic(best for smooth gradients).Press OK.
Now go to File->Save as... and save a copy as Photoshop RAW file. In the save dialog enter some name with AMP extension(this way PS will save the file as RAW image but with AMP extension. At least this is so on Windows:)). Next comes up the Photoshop RAW options dialog. Here leave the Header field 0, but check the Non-Interleaved order! Press OK and OK to warning that comes later. Now you can go back in the History panel to undo the Image Size command.

Let us go to your target image(or layer) with your grayscale map. Here add Curves layer. On this layer go to panel menu and choose Load Curves Preset.... In the dialog choose AMP file type and open the AMP file you've created in the first step. This is it!

To change the direction of the gradient add Invert layer under the Curves layer.

P.S. As of some time ago PS started adding some S curve to Curves. If it bothers you we can compensate this a little by adding yet another Curves layer over your grayscale map. In this layer add 4 points(Input, Output): (0, 0), (54,64), (127, 127), (192, 180), (255,255).

Hope this helped.
 

Top