“Rubber Matrix” and “Sparse Montage” wrapper for ImageMagick

Last night, I was working on a bunch of images and I really wanted to just get a visual overview along the lines of a scatter plot, but with images rather than dots. Unfortunately, no matter what I searched for, I couldn’t find anything to do what I wanted.

ImageMagick’s montage tool can do it… but you have to manually fill in the empty cells with the special filename null:

…so I wrote a script to do just that.

Oh, and I got carried away and wrote a “rubber matrix” class to abstract away the actual generation of the grid. Basically, it’s a DictMixin-based class that insists on consistently sized tuples as keys and then adds some extra methods to traverse them as sparse points in a matrix dynamically sized to only the rows/columns/etc. which exist.

I haven’t yet decided on what command-line syntax I want, so you have to import it, but it works perfectly in my preliminary tests.

CC BY-SA 4.0 “Rubber Matrix” and “Sparse Montage” wrapper for ImageMagick by Stephan Sokolow is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

This entry was posted in Geek Stuff. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

By submitting a comment here you grant this site a perpetual license to reproduce your words and name/web site in attribution under the same terms as the associated post.

All comments are moderated. If your comment is generic enough to apply to any post, it will be assumed to be spam. Borderline comments will have their URL field erased before being approved.