Scale images with PIL preserving transparency and color?

前端 未结 4 1707
花落未央
花落未央 2021-02-08 07:27

Say you want to scale a transparent image but do not yet know the color(s) of the background you will composite it onto later. Unfortunately PIL seems to incorporate the color v

4条回答
  •  北恋
    北恋 (楼主)
    2021-02-08 07:47

    Maybe you can fill the whole image with the color you want, and only create the shape in the alpha channnel?

提交回复
热议问题