From 87c669d95973f61aa451733183d683d41fe4cbb5 Mon Sep 17 00:00:00 2001 From: James O'Leary Date: Wed, 2 Jun 2021 10:35:05 -0400 Subject: [PATCH] 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 --- core/java/android/app/WallpaperColors.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/java/android/app/WallpaperColors.java b/core/java/android/app/WallpaperColors.java index edd60473c5227..b9e5c090a4870 100644 --- a/core/java/android/app/WallpaperColors.java +++ b/core/java/android/app/WallpaperColors.java @@ -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;