I'm trying to adapt the code from this page with a slightly different purpose:
Mapping an image with random coordinates, using PIL, without them stay one on top of the other
I'm using a black background in the back with 2 images (a white X and an orange dot) made with transparent background.The result is a complete black background.I'd like to have the orange dot behind the white X cross but unfortunately nothing is visible.
https://i.ibb.co/WfZ4NhQ/background2.png
https://i.ibb.co/Lvm3CbD/orangedot.png
https://i.ibb.co/23mXjqm/whiteX.png
https://i.ibb.co/FYMg8QL/test.png
from PIL import Image
import random
#whiteX = 200x200
#orangedot = 30x30
background2 = Image.open('background2.png')
whiteX = Image.open('whiteX.png')
orangedot = Image.open('orangedot.png')
positionxorangedot = random.randint(30, 170)
positionyorangedot = random.randint(0, 100)
background2.paste(whiteX)
background2.paste(orangedot, (positionxorangedot, positionyorangedot), orangedot)
background2.save("test.png")
background2.show()
As a last action I would like to save (for example 500 times) the output files in jpg or similar format. I have tried various solutions without being able to write anything really functional... any help really appreciated! How do you suggest I proceed?