Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 9b927684 authored by James O'Leary's avatar James O'Leary
Browse files

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
parent fbbb5dd5
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment