From cb1296ea17319d48320c499aa409770bc78605ae Mon Sep 17 00:00:00 2001 From: yimoxiao <73517726+yimoxiao@users.noreply.github.com> Date: Sat, 21 Jun 2025 23:30:09 +0800 Subject: [PATCH] chore(lvglimage): fix indexed image premultiply error (#8367) --- scripts/LVGLImage.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/LVGLImage.py b/scripts/LVGLImage.py index bc631a1e68..30a64a1b25 100755 --- a/scripts/LVGLImage.py +++ b/scripts/LVGLImage.py @@ -615,7 +615,9 @@ class LVGLImage: if self.cf.is_indexed: - def multiply(r, g, b, a): + def multiply(b, g, r, a): + # The precision is reduced, the correct way would be to divide by 255, + # but this is consistent with the premultiply function in the code. r, g, b = (r * a) >> 8, (g * a) >> 8, (b * a) >> 8 return uint8_t(b) + uint8_t(g) + uint8_t(r) + uint8_t(a)