Combine/merge vertically multiple images from multiple folders into one image for each folder

Viewed 12

I'm facing a feature that I'm not able to do after looking at some tutorials, with several way of doing it. So it's a project in Python. As you can see below I have some images that are located in some folders.

What I would like to do is to combine/merge the images that are located in a folder in only one image, for each folder. So 001.jpg, 002.jpg, 003.jpg, 004.jpg inside folder 0 needs to be merged as 0-merged.png. I'm putting the output image as a .png because my images are really long vertically, and jpg have a maximum size. For info, the width of my images are always the same, only the height is not.

Then do the same for all others folders.

.
├── 0
├─────001.jpg
├─────002.jpg
├─────003.jpg
├─────004.jpg
├── 1
├─────001.jpg
├─────002.jpg
├─────003.jpg
├── 2
├─────001.jpg
├─────002.jpg
├─────003.jpg
├─────004.jpg
└─────005.jpg

I have tried a lot of stuff found on internet, for example Numpy, imageio, imagemagick (output png is way too big), etc. But I couldn't make it work properly...

If someone can help that would be great :)

Thanks ! Btv-

0 Answers
Related