- Published on
Create a mosaic of pictures for free with Image Magick and GIMP
- Authors
- Name
- Ali Tarraf
- @alitarraf
This is an incomplete note of what I did to create a beautiful image of my girlfriend memories for her birthday.
- Download Gimp
- Download Image Magick
- Plan your mosaic layout
- My final image was 3000px x 2550px
- I cropped and sized all my images to 150px x 150 px
- So we have a width/columns of 20 pictures by 150px = 3000 px
- And a height/rows of 17 pictures by 150px = 2550px
- Total image needed would be 20x17=340 pictures
- Prepare photos with Image magick and create the image tile pattern
- 340 images to crop and position, doing so with image magick is easy with the following command. Create 1st a folder named cropped inside the folder where you have the 340 pictures.
- Crop everything with this command from terminal
mogrify -gravity center -crop 1:1 -path ./cropped *.jpg
- Manually re-position the crop window to your liking since the command above is gravity centered and crop from the center.
- Resize all images to 150x 150 with this image magick command
mogrify -resize 150x150 -path ./resized *.jpg
- Create the tiled mosaic pattern collection of 340 images with the following command:
montage *.jpg -tile 20x17 -geometry +0+0 pattern.jpg
- Use Gimp to overlay the tile mosaic pattern to the big image
- Choose the main image and scale it up or down to the size of your pattern, in this case 3000x2550px. Use Gimp image scale function to do that
- In Gimp add the main image, and the pattern image into Gimp as separate layers
- Select overlay or addition mode on the main image. Play with different settings to your liking, like the opacity.