Once upon a time when I didn't know Unreal or tech art yet, I was working on a summer game project as one of the artists/animators and we had to make the sprite sheets manually and I was mad forevermore. (None of the online ones I found seemed to work the way we needed it to at the time.)
So today I made a simple sprite sheet generator :)
This script assumes all images will be the same size and format, and named numerically. It takes a selected folder and combines all images (excluding any previously existing spritesheet) inside the folder into one sprite sheet, located in the same folder and named after the folder itself.
To select a folder, I use tkinter to bring up file explorer, os to read folders, and Pillow/PIL for image processing.
Running this script opens a window with one button. Clicking it brings up Windows Explorer so you can select a folder. After one's been selected, it will get all the files inside the folder as a list.
Get the image size, format (PNG, JPEG, etc), and mode (RGB, CMYK, etc) from the first image instance in the list.
If the first image is a previous sprite sheet, remove it from the list and get the image info from the next image.
(I can't remove the sprite sheet beforehand because I need to get the format first.)
I use the square root of the amount of images to decide how many rows and columns to make.
They're the same right now, but could be adjusted in the future to be more efficient with empty spaces.
I make an empty image instance with the corresponding size, then use a for loop and if statement to paste every sprite into it at the right location.
Once all images are pasted, it crops the new image instance in case an unused column was made and saves it in the folder.
https://www.youtube.com/watch?v=q8WDvrjPt0M
https://pillow.readthedocs.io/en/stable/handbook/tutorial.html
Sprites made by me.