For example I added a new attribute called turtle above ^. But when the composite is formed the result images are only of the turtle and it doesn't include any of the orange or blue backgrounds or squares and circles.
Can you try to add a new composite? It will let the processor know which combination of shapes you want to generate.
for item in all_images:
im1=Image.open(f'./layers/backgrounds/{background_files[item["Background"]]}.jpg').convert('RGBA')im2=Image.open(f'./layers/circles/{circle_files[item["Circle"]]}.png').convert('RGBA')im3=Image.open(f'./layers/squares/{square_files[item["Square"]]}.png').convert('RGBA')//addthislineofcodeim4=Image.open(f'./layers/squares/{square_files[item["Turtle"]]}.png').convert('RGBA')#Create each composite
com1=Image.alpha_composite(im1,im2)com2=Image.alpha_composite(com1,im3)//addnewcombination3com3=Image.alpha_composite(com2,im4)#Convert to RGB
rgb_im=com3.convert('RGB')
`
You can use for statement to handle this process better. something like this
`
forshapeinshapeList://generatergb_img....
`
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
background = ["Blue", "Orange"]
background_weights = [30, 40]
circle = ["Blue", "Orange"]
circle_weights = [30, 15]
square = ["Blue","Orange"]
square_weights = [30, 15]
turtle = ["Blue","Orange"]
turtle_weights = [30,15]
For example I added a new attribute called turtle above ^. But when the composite is formed the result images are only of the turtle and it doesn't include any of the orange or blue backgrounds or squares and circles.
Can you try to add a new composite? It will let the processor know which combination of shapes you want to generate.
for item in all_images:
`
You can use for statement to handle this process better. something like this
`
`