Oh I see what you meant. I reduced it to 8 and It worked. What can I do to generate more images though? I mean the goal is generate a couple thousand images.
You can add different colours and shapes (rectangle, star) to generate more images to get familiar. A good practice would be having different characters with a set of variation. For instance:
Furthermore, you can add more colours to create more images according to the following example.
[shape]_weights should be added up to 100 (optional) and the less the shape weights the less likely it will be populated.
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.
I just have two of each.
backgrounds (folder name)
-> blue.png
-> orange.png
circles
-> blue-circle.png
-> orange-circle.png
squares
-> blue-square.png
-> orange-square.png
Ok. Can you try to reduce the total images down to 8?
Reduce to 8? I only have 6 total images. blue.png, orange.png (background pics), two circles and two squares. Six total images.
Oh I see what you meant. I reduced it to 8 and It worked. What can I do to generate more images though? I mean the goal is generate a couple thousand images.
Could you explain the way the weights work?
You can add different colours and shapes (rectangle, star) to generate more images to get familiar. A good practice would be having different characters with a set of variation. For instance:
Furthermore, you can add more colours to create more images according to the following example.
[shape]_weights should be added up to 100 (optional) and the less the shape weights the less likely it will be populated.
`
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
`
`