My Problem My customers are uploading images to put on a t-shirt. I need to know how many main colors are within the design. I have tried PHP scripts and Imagemagick , I can't seem to get the results I am looking for.
This image has 5 main color variations. When I use imagemagick's -unique-colors, I get a huge range of different colors. Is there a line of code or script that I can use to get an outcome of 5.
Here is the code I am using to try and get unique color count with imagemagick but I get way to many colors.
exec(convert $origimage -unique-colors -scale 1000% $newimage);