Last active
October 19, 2022 19:04
-
-
Save SKaplanOfficial/3b3152f0c061698edc451fd05c703b9f to your computer and use it in GitHub Desktop.
PyXA script to stitch images together vertically and horizontally
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
import PyXA | |
from random import random | |
# Horizontal stitching | |
colors = [PyXA.XAColor(random(), 0, random()) for i in range(100)] | |
swatches = [c.make_swatch(10, 500) for c in colors] | |
PyXA.XAImage.horizontal_stitch(swatches).show_in_preview() | |
# Vertical stitching | |
files = ["/Users/exampleUser/Desktop/cat1.jpeg", "/Users/exampleUser/Desktop/cat2.jpeg", "/Users/exampleUser/Desktop/cat3.jpeg"] | |
images = [PyXA.XAImage(file) for file in files] | |
PyXA.XAImage.vertical_stitch(images).show_in_preview() |
Author
SKaplanOfficial
commented
Oct 19, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment