Closed Crissov closed 9 years ago
What would you use that information for?
To not select more colors than I actually need in pictures with very few colors.
If the number of colors is lower than 256, then you don't need to worry about it, because:
If the number of colors is higher than 256, then to figure out if that's good enough, there's no better way than looking at the actual image :)
The raw number doesn't mean much — you can have an image that has 256 different colors and tiny barely noticeable noise that bumps the count to 2000 unique RGB combinations, but it'll look fine in 256. Or you can have an image with a rainbow of 300 colors that will look worse when 40 colors are removed.
I see, but this is more of a user experience issue than a technical one. As a casual user I won’t know such details. Think of it as a “lossless threshold” indicator that provides a fuzzy feeling of assurance that I’m not destroying my picture without looking at it closely.
You are right of course, that a mere count cannot cover cases of similar colors – heck, reducing colors can sometimes remove prior compression artifacts (but also anti-aliasing). A histogram would help with that, but I understand that the workflow of ImageAlpha mostly relies on visual inspection.
If you're willing to trust an algorithm, then I suggest using ImageOptim 1.6 with lossy option, which has this "lossless threshold".
ImageAlpha should tell me how many unique colors my image contains or it should limit the upper bound to that.