SixLabors/Samples

AvatarWithRoundedCorner not transparent

thhet opened this issue · 3 comments

thhet commented

It seems, that the rounded corner sample is not working well with photo images. The cut out corners are not transparent for a lot of images. Cliparts are usually ok, but real world images tend to produce black corners.

sprinkles

fb-round

I’m assuming from the output these images are jpegs?

If so, that’s expected as jpegs do not contain an alpha channel.

thhet commented

Input image is a png. But your comment has led me to a solution: When I serialize the selected image into a memory stream using a PngEncoder with ColorType = PngColorType.RgbWithAlpha, load the image from this stream and than apply rounded corners everything works as expected.

Thanks for your reply!

Excellent! Glad you worked it out 👍