generative-art-nft icon indicating copy to clipboard operation
generative-art-nft copied to clipboard

top layers with textures of lower opacity (slight transparency) issue

Open trinichad opened this issue 3 years ago • 2 comments

Hi,

I noticed when I stitch layers using the generator tool, the top layer images that have shadows with lower opacity or slight transparency make the final generated image have that transparency. See Below:

0014

image

Any ideas on how I can avoid this? Thanks, Chad

trinichad avatar Dec 19 '21 17:12 trinichad

I noticed this when I went to make a GIF in photoshop of a few of the generated images. Images were showing through each other.

trinichad avatar Dec 19 '21 18:12 trinichad

FYI. I have the issue mentioned in: https://stackoverflow.com/questions/5324647/how-to-merge-a-transparent-png-image-with-another-image-using-pil

"Image.paste does not work as expected when the background image also contains transparency. You need to use real Alpha Compositing."

I try to change the code "bg.paste(img, (0,0), img)" in line 74 of file nft.py to "bg = Image.alpha_composite(bg, img)" and it works.

wmyao avatar Aug 10 '22 03:08 wmyao