Resize operation creates grey lines on image with transparency #4588
Answered
by
jcupitt
most-available-username
asked this question in
Q&A
-
Beta Was this translation helpful? Give feedback.
Answered by
jcupitt
Jun 27, 2025
Replies: 1 comment 1 reply
-
image = image.premultiply().resize(0.3).unpremultiply()
There are usually three approaches:
There are other factors to consider too: for example, |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
most-available-username
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @most-available-username,
resize
doesn't know about alpha channels -- it treats all bands equally. Therefore, if there's an alpha, you need to premultiply before resize. Something like (python):thumbnail
is a higher-level resize operation and it does all of this stuff for you.There are usually three approaches: