ColorCube icon indicating copy to clipboard operation
ColorCube copied to clipboard

Wrong dominant color for transparent images (Python)

Open mickeyl opened this issue 9 years ago • 1 comments

Hi,

for the image https://upload.wikimedia.org/wikipedia/commons/thumb/e/ef/NDR_Info_Logo.svg/1280px-NDR_Info_Logo.svg.png I get the following (wrong) output:

[0, 0, 0] [0, 50, 101] [255, 194, 0] [121, 92, 0]

Obviously there are no black pixels whatsoever in this image – it looks like the fully transparent pixels are getting count. How does your program deal with alpha values? Can we teach it to ignore them or – perhaps better – take the alpha value into account for the pixel representation?

mickeyl avatar Mar 30 '16 17:03 mickeyl

Good point. An option to use the alpha channel as a weight in the calculation would be handy.

pixelogik avatar Jul 18 '18 08:07 pixelogik