First I created a small image using paint.net image editing software. The canvas size of this image is 30x30 pixels. You can create any image you want. I chose this one because I was looking for a simple dark background similar to carbon fiber or treadplate. I have a Seagate external USB drive that had this texture on the outside and I liked the way it looked.
import PIL
from PIL import Image
displayRes = (1920,1080)
black = (0,0,0)
stepSize = 30
treadPlate = Image.open("your_small_image_name.png")
image = PIL.Image.new(mode = "RGB", size = displayRes)
image.paste(black, (0,0,displayRes[0],displayRes[1]))
image.paste(treadPlate, (0,0))
for y in range(0, displayRes[1], stepSize):
for x in range(0, displayRes[0], stepSize):
image.paste(treadPlate, (x,y))
image.save("Background1.png","PNG", quality=100)
print(image.format, image.size, image.mode)
display(image)
No comments:
Post a Comment