I'm setting up a wiki for a game, and I need to put GIFs for make the site easier to understand. But I have a problem. To make the GIFs I need to merge some images, I did it image by image manually, which is annoying. So what language can I use to automate this?
I've tried some codes with python, and I haven't had any success. The only way I can make it work was using Photoshop to combine these images.
I tried this code:
import numpy as np
from PIL import Image
images_list = []
for i in range(1,4): #insert last number of photo
images_list.append(str(i)+'.PNG')
count = 1;
directory = "C:/Users/Windows/Desktop/BloodStoneSprites/sprites1"
#change to directory where your photos are
ext = ".PNG"
new_file_name = "vimage-"
new_directory = "C:/Users/Windows/Desktop/BloodStoneSprites/Uniao" #
change to path of new directory where you want your photos to be saved
for j in range(0,len(images_list),2):
name = new_file_name + str(j) + ext
two_images_list = [images_list[j],images_list[j+1]]
imgs = [ Image.open(i) for i in two_images_list ]
min_img_shape = sorted( [(np.sum(i.size), i.size ) for i in imgs])[0][1]
imgs_comb = np.hstack( (np.asarray( i.resize(min_img_shape) ) for i in
imgs ) )
imgs_comb = Image.fromarray( imgs_comb)
imgs_comb.save(new_directory+'/'+name )
count +=1
And here are some images I need to combine: https://i.stack.imgur.com/nvd8N.jpg