Skip to content

Instantly share code, notes, and snippets.

@aasmpro
Created April 16, 2020 17:08
Show Gist options
  • Save aasmpro/341dc01ceef7eee3ac14068cab304f87 to your computer and use it in GitHub Desktop.
Save aasmpro/341dc01ceef7eee3ac14068cab304f87 to your computer and use it in GitHub Desktop.
craete pattern with python
from PIL import Image
import sys
image = Image.open(sys.argv[1])
image = image.resize((10, 10), Image.ANTIALIAS)
image2 = Image.new('RGB', (1000, 1000))
for y in range(0, 1000, 10):
for x in range(0, 1000, 10):
image2.paste(image, (x,y))
image2.save(sys.argv[2], 'PNG', quality=100)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment