You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Sir, I need to export a Pillow image with a background (255, 255, 255, 0), I use this code to initialize the Skia to try to set the background as (255, 255, 255, 0)
with self.surface as canvas:
color = skia.Color(255, 255, 255, 0)
canvas.clear(color)
After I draw a line on the surface and use this code to export a Pillow image
skia_image = self.surface.makeImageSnapshot()
alphaType=skia.AlphaType.kUnpremul_AlphaType)
res = skia_image.convert(colorType=skia.ColorType.kRGBA_8888_ColorType,
alphaType=skia.AlphaType.kUnpremul_AlphaType)
return Image.fromarray(
res
)
But the background is (0, 0, 0, 0) when get the pillow Image
Please help! it will be greatly appreciated.
Thanks.
The text was updated successfully, but these errors were encountered:
woestler
changed the title
Cannot get background (255, 255, 255, 0) for Pillow image
Unable to get background (255, 255, 255, 0) for Pillow image
May 30, 2022
Describe the bug
Sir, I need to export a Pillow image with a background (255, 255, 255, 0), I use this code to initialize the Skia to try to set the background as (255, 255, 255, 0)
After I draw a line on the surface and use this code to export a Pillow image
But the background is (0, 0, 0, 0) when get the pillow Image
Please help! it will be greatly appreciated.
Thanks.
The text was updated successfully, but these errors were encountered: