Don't interpolate image input to quantizer

With `false`, nearest neighbor is used during scaling, with `true`,
bilinear interpolation is used. Bilinear interpolation can introduce
colors that weren't in the original image (ex. overemphasizing red/brown
highlights in a mostly B+W image of the Mandolorian). Better to avoid
that.

Bug: 189931209
Test: Test tons and tons of wallpapers over a couple days.
Change-Id: I425f95793ca593dbbc5008ef59f4baedaea318a6
This commit is contained in:
James O'Leary
2021-06-02 10:35:05 -04:00
parent d4b3a8faeb
commit 87c669d959

View File

@@ -176,7 +176,7 @@ public final class WallpaperColors implements Parcelable {
shouldRecycle = true;
Size optimalSize = calculateOptimalSize(bitmap.getWidth(), bitmap.getHeight());
bitmap = Bitmap.createScaledBitmap(bitmap, optimalSize.getWidth(),
optimalSize.getHeight(), true /* filter */);
optimalSize.getHeight(), false /* filter */);
}
final Palette palette;