ColorCube
ColorCube copied to clipboard
Wrong dominant color for transparent images (Python)
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?
Good point. An option to use the alpha channel as a weight in the calculation would be handy.