Mass process and update a batch of images using GIMP
In various occasions, it is useful to update in one shot a batch of images. This operation takes a few minutes to setup using the Batch image manipulation plugin for the GIMP.
In only a few clicks, it is possible to update as many images as you want – resize, change format, …
First of all, download and install the GIMP Batch image manipulation plugin [1] – assuming, of course, that you already have installed the great GNU Image Manipulation Program, the GIMP [2]
You can then start The GIMP, and launch the Batch image manipulation plugin from GIMP File menu.
As an example, let’s optimize a batch of ~15 000 images of all kind (jpg, png, …), totalling ~1.5GB. Two operations will be necessary : resize the images, and save them in jpg format.
First step, resizing them. To do so, add a Resize action from the BIMP standard options (Fig 1). Select then your options – in my case, resize them all to 200 pixels wide, preserving their aspect ratios. (Fig 2)
Then, add a second action, change of format and compression (Fig 3). Here again, it is possible to select a few options (Fig 4) – the more important in this case being the quality. But feel free to play with the advanced paramaters and see what is working best for you.
Now that all actions are setup, select your images – one by one, or folder by folder (Fig 5). It took about 5 minutes to generate the list of my 15 000 images.
Check the “Keep folder hierarchy” option in case you have subfolders. Your resulting images in your output folder will follow the same hierarchy. It is as simple as using a different folder in the web script, upload the pictures and the script, and it is done.
Finally, click on Apply, and wait for the magic to happen (Fig 6). In my example (~15 000 images, 1.5GB), it took about 45 minutes to complete the whole batch. This of course depends on processing power.
Result is as follow : 1.5GB before batch resize and format / compression change (Fig 7), and 170MB after (Fig 8). This is how powerful and easy the GIMP is !
For example, this allowed me to pass the Google PageSpeed [3] test Optimize images [4] on a website, going up from a score of 17 on mobile (Fig 9) to 51 (Fig 10), and up from 35 (Fig 11) to 59 on desktop (Fig 12).
Links and credits
- [1] – BIMP. Batch Image Manipulation Plugin for GIMP. | Alessandro Francesconi – www.alessandrofrancesconi.it
- [2] – GIMP – The GNU Image Manipulation Program – www.gimp.org
- [3] – PageSpeed Insights – developers.google.com
- [4] – Optimize Images PageSpeed Insights Google Developers – developers.google.com
Images
- Fig1 : BIMP, Batch Image Manipulation plugin for GIMP – select resize action
- Fig2 : BIMP, Batch Image Manipulation plugin for GIMP – resize options
- Fig3 : BIMP, Batch Image Manipulation plugin for GIMP – select change format and compression action
- Fig4 : BIMP, Batch Image Manipulation plugin for GIMP – change format and compression action to jpg options
- Fig5 : BIMP, Batch Image Manipulation plugin for GIMP – add image folders
- Fig6 : BIMP, Batch Image Manipulation plugin for GIMP – end of manipulation and success message
- Fig7 : BIMP, Batch Image Manipulation plugin for GIMP – folder status before processing
- Fig8 : BIMP, Batch Image Manipulation plugin for GIMP – folder status after processing
- Fig9 : Google Page Speed – Score before image optimization of 17 on mobile
- Fig10 : Google Page Speed – Score after image optimization of 51 on mobile
- Fig11 : Google Page Speed – Score before image optimization of 35 on desktop
- Fig12 : Google Page Speed – Score after image optimization of 59 on desktop