Skip to main content
Davince.net
Known Participant
May 11, 2022
質問

Automation for creating a gradient from colours within a selection

  • May 11, 2022
  • 返信数 3.
  • 576 ビュー

Trying to automate something but can't think how to approach it best. The manual method being used is:

1: Selection made of an area within an image
2: From that selection, 5 colour samples taken - Darkest, Dark-mid, Mid, Mid-Light, Lightest - based on luminosity, attempting to be equidistant across the luminosity range of the selection. (so for example if darkest area is 20% brightness, lightest is 80%, you'll get samples at 20%, 35%, 50%, 65%, 80% brightness)
Gradient created using the sample colours, with the location of each colour marker in the gradient specified by the brightness value.
Gradient saved with the file name as reference. 

Probably some really simple solution to this I'm simply unaware of. Or it's way too complex for me, but I'm sure there must be some way to do it?



このトピックへの返信は締め切られました。

返信数 3

Chuck Uebele
Community Expert
Community Expert
May 14, 2022

I have done something along those lines, but what I do is sample specific points to get the color to apply  as gradient to a shape. The shapes are morphed via script, and the color sample points are also scripted, once I manually set their reference placement to the shapes to be morphed. 

 

c.pfaffenbichler
Community Expert
Community Expert
May 12, 2022

I am afraid Gradients under »Extract from Image« do not offer the options you want (in this case the luminosity as determining factor). 

Davince.net
Davince.net作成者
Known Participant
May 13, 2022

Question for you while you mention the extract tool... all my files are in Adobe RGB, if I use the extract tool, it seems to work only in sRGB colour space, is that correct? Any gradients I've created with that are completely the wrong colours in adobe rgb space.

c.pfaffenbichler
Community Expert
Community Expert
May 14, 2022

@Davince.net wrote:

Question for you while you mention the extract tool... all my files are in Adobe RGB, if I use the extract tool, it seems to work only in sRGB colour space, is that correct? Any gradients I've created with that are completely the wrong colours in adobe rgb space.


Frankly I am not sure. 

The picking seems to cause some change, but in a quick test it does not seem to conform to an Adobe RGB-to-sRGB-conversion. 

c.pfaffenbichler
Community Expert
Community Expert
May 12, 2022

Probably some really simple solution to this I'm simply unaware of. Or it's way too complex for me, but I'm sure there must be some way to do it?

I suspect you under-estimate the issue. 

If I understand your description correctly you would essentially need to evaluate each pixel in the selection, order them by luminance, then choose the 5 pixels that meet the luminance-requirements. 

 

• Alas, what if multiple pixels of differing hue and/or saturation meet the luminance-requirements? 

• Assessing the pixels’ values by Color Picker would only be reasonable with small Selections, otherwise exporting the RAW data may be more efficient. 

• If the Selection isn’t rectangular the issue gets more complicated. 

 

Could you please post screenshots with the pertinent Panels (Toolbar, Layers, Options Bar, …) visible to illustrate? 

Davince.net
Davince.net作成者
Known Participant
May 13, 2022

That's a very good point you make regarding multiple hues of the same luminence. I hadn't thought of that aspect. I'll grab some screenshots when I'm back in the office. I often mosaic the image first to make it a bit less complex and reduce the palette (much like creating a colour table using indexing or gif export)

Might have to think of a new approach, though.