Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Automation for creating a gradient from colours within a selection

Participant ,
May 11, 2022 May 11, 2022

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?



TOPICS
Actions and scripting
626
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Community Expert ,
May 12, 2022 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? 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 13, 2022 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 12, 2022 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). 

Screenshot 2022-05-12 at 10.15.43.png

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 13, 2022 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 14, 2022 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. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 18, 2022 May 18, 2022
LATEST

I tried a few more last night after wrapping up "proper" work - if I extract a gradient and then use in the Adobe RGB image immediately... it doesn't work, totally the wrong colours. If I apply that gradient in a new sRGB image, convert it to Adobe RGB then recreate the gradient anew, and then use back in the original, it's perfect. That's a major, major flaw for me.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 14, 2022 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. 

 

FB_IMG_1555710112370.jpg

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines