How to find the nearest color from a list of 9 in Photoshop?

I’ve a picture of an static object correctly balanced and exposed:

I would like to sample the nearest color from my own palette of 9 RGB or Lab using Photoshop:
enter image description here

Colour palette:



You can use this nice script to get your Delta-E values.

You can find it here on pastebin. Just copy the code into notepad, or another text editor like notepad++, and save it out as a .jsx file.

enter image description here

Then, you can run it by dropping the script into your Photoshop scripts folder found under:

C: \ Program Files \ Adobe \ Your Photoshop Version \ Presets


  1. Load your image in PS
  2. With the Pen tool P draw a perimeter that will correspond to the four corner marks of the chart, starting with the upper left corner, then the lower left, the lower right, the upper right and closing in the upper left like so:

enter image description here

  1. Run the script by going to File>Scripts>color-analysis

enter image description here

  1. The script will run, leaving a series of black circles for each measurement, to show where the measurement was, and what area it occupied.
  2. In the same directory that the evaluated image occupies, a file will be created with the same name as the image processed with _color_analysis.txt added to the end.

Source : Link , Question Author : Borexino , Answer Author : Ovaryraptor

Leave a Comment