Created
March 3, 2018 21:24
-
-
Save Koenvh1/992f67d31a6e94d95a39a9a0d2573ccc to your computer and use it in GitHub Desktop.
Create an album image mosaic
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from os import system, listdir, chdir | |
import random | |
for current_row in range(9): | |
images = [] | |
for i in range(16): | |
images.append("artistart\\" + random.choice(listdir("artistart"))) | |
print(images) | |
system("magick " + " ".join(images) + " +append artistart\\rows\\row" + str(current_row) + ".png") | |
rows = [] | |
for key in listdir("artistart\\rows"): | |
rows.append("artistart\\rows\\" + key) | |
system("magick " + " ".join(rows) + " -append result.png") | |
system("magick result.png -resize 1920x1080 -quality 70 -depth 8 result.jpg") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment