Skip to main content
Participating Frequently
January 21, 2019
Question

Compare multiple colors

  • January 21, 2019
  • 2 replies
  • 477 views

Hi,

Im currently writing a script for Photoshop in Extendscript.
Now Im trying to figure out, how to compare colors to each other. I've mostly tried to stick to wikipedias​ article about comparing colors and using a weighed eucledian algorithm i get a distance which indicates their difference. Comparing 2 colors is no problem with that.

But in my script I have 3 Inputs (Most common color, second most common color, and the third most common color). Now if I want to compare this to their aquivalent part, lets stay I have a Main_tile with their 3 Inputs and a Tile_file with 3 Inputs, I can compare (Common to common, second common to second common..), which seems to work fine.

My question is what happens if my Tile_file has only 1 Input, how do I compare it to the Main_tile?

Example:
MostCommonColorA          compared to      MostCommonColorB            gives me a difference of 50;
2ndMostCommonColorA    compared to      2ndMostCommonColorB      gives me a nother difference of 20; .. which is now 70.

If I compare only MostCommonColors, i get 50. So I'd theoretically be picking 50, but thats not really what I want, so how can I weight it properly?

Thanks in advance for the help!

This topic has been closed for replies.

2 replies

rob day
Community Expert
Community Expert
January 23, 2019

Or ask in the Photoshop Scripting forum, this forum doesn't get much traffic and the visitors might not know JS.

Photoshop Scripting

NB, colourmanagement
Community Expert
Community Expert
January 22, 2019

Hi TK289

This question's way over my pay-grade

- and I think probably beyond the scope of this forum, as the lack of replies would seem to suggest

why not ask Phil Green at the 


University of the Arts London - London College of Communication?

Or Steve Upton at Chromix?

I hope this helps

if so, please do mark my reply as "helpful"

thanks

neil barstow, colourmanagement