Ignore transparent pixels during WSMeans
The WSMeans quantizer uses starting clusters from a Wu quantizer as starting points for an optimized Kmeans algorithm. The first thing the quantizer does is assign pixels from the image being quantized to those starting clusters. Either due to the image source or downscaling, transparent pixels may be in the pixels. Filter those out: they create misleading results, such as there being two colors in the image, semi-transparent black and green, in a wallpaper that is solid green by all accounts. Fixes: 182333325 Test: atest CtsAppTestCases:android.app.cts.WallpaperColorsTest#fromDrawableTest passes locally on sunfish. link: http://ab/I26300007868608112 Change-Id: Icaebd98eeba27d3dc59a698282dd3be03fce1bf9
Loading
Please register or sign in to comment