transparent

how to round_corner a logo without white background(transparent?) on it using pil?

how to round_corner a logo without white background(transparent?) on it using pil? Question: I got a square logo and I need to round_corner it, searched for a while and got the follow code “working”: def round_corner_jpg(image, radius): “””generate round corner for image””” mask = Image.new(‘RGB’, image.size) #mask = Image.new(‘RGB’, (image.size[0] – radius, image.size[1] – radius)) …

Total answers: 3

Transparent PNG in PIL turns out not to be transparent

Transparent PNG in PIL turns out not to be transparent Question: I have been hitting my head against the wall for a while with this, so maybe someone out there can help. I’m using PIL to open a PNG with transparent background and some random black scribbles, and trying to put it on top of …

Total answers: 1

How to get alpha value of a PNG image with PIL?

How to get alpha value of a PNG image with PIL? Question: How to detect if a PNG image has transparent alpha channel or not using PIL? img = Image.open(‘example.png’, ‘r’) has_alpha = img.mode == ‘RGBA’ With above code we know whether a PNG image has alpha channel not not but how to get the …

Total answers: 5