When working with scripts that generate plots, there is occasionally a (possible contrived) need to place these plots side by side to compare the results (say, different bar graphs) and lay them out in a nice grid like fashion. Of course, the CLI gods forbid doing this using a mouse.
Now, I came across imagemagick, a FOSS suite for image manipulation. It comes with a tool called montage
, which lets you organize images in a specified layout (in my case, I wated a nice 3x3 grid). It even lets you apply formatted labels to each image (so you know where each one came from, because you were too lazy when you wrote those scripts to actually do that)
Broken down in the worst possible way (because this is off the top of my head)
- -font : The font to use (since it couldn’t find the font on my system without this argument, defaulted to null for some reason)
- -tile : I wanted a nice 3x3 grid
- -pointsize : Font size to use
- -geometry : If you want it to insert space between the different tiles
And this produces out.png with a nice little grid and filenames as labels.