0

I am working in Photoshop CC and I have only 7 selected colors in our swatches.

After the process has been done we will do the indexing. After that is there any possibility to check if there are any other colors present except for those 7 colors? If it's there can we get some notification saying that there are other colors present in the image or at least can we check that only the colors which we have in swatches are present in the output image?

1

If the image is well indexed, go to Menu Image > Mode > Color Table

This Color Table has all the colors of your image:

enter image description here

  • 2
    ..from there you could also select a table that only has your colours present. – mayersdesign Jun 5 '18 at 18:32
  • I'm not sure that this is answering his question. He already has a list of the indexed colors but he's looking for a programing solution to double-check the output/ – Ovaryraptor Jun 5 '18 at 20:21
  • Yes, you are right, there are three questions, this answer is just for the first part: —is there any possibility to check is there any other colors present except that 7 colors— – Danielillo Jun 5 '18 at 20:25
  • 1
    This is the right answer because the Color Table do what you want without any script. – LeoNas Oct 4 '18 at 12:05
0
  1. There are many JS plugins to check the dominant color of image and also make a list of colors. For example, there is a tool called Color Thief, which uses JavaScript and the canvas tag. On the website below you can try it simply by upload your own image.

Color Thief

I checked the code and it seems that this plugin builds a palette of all the colors on the image by getPalette method, it should looks like this:

var colorThief = new ColorThief();
colorThief.getPalette(sourceImage, 8);
getPalette(sourceImage[, colorCount, quality])
returns [ [num, num, num], [num, num, num], ... ]
  1. There is also an extractor called Vibrant.js, which is a port of an Android's Palette class. You can check it out on the link below:

Vibrant.js

It seems to has three main parameters:

new Vibrant(
    img,
    64, /* amount of colors in initial palette from which the swatches will be generated, defaults to 64 */
    5 /* quality. 0 is highest, but takes way more processing. defaults to 5. */
)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.