I’w writing a PHP script that uses Montage, which is an extension of ImageMagick that creates tiled arrays of images. The Montage syntax is straightforward:
montage image1.png image2.png image3.png -tile x1 -geometry 50x50 out.png
However, I’m generating these images on the fly and I would hate to have to write them to disk just to run this command. Is there some way I can pass there resources in without writing them to file?
(This isn’t really a Montage question, but rather a general question that could apply to many different situations.)
Any help would be great!
As I commented, you could find some tmpfs file system (e.g. with
df | grep tmpfs) such as/runand put your files inside. They will then live within the virtual memory (and won’t usually need any disk I/O). Of course the space they take are consuming virtual memory resources (so are limited).BTW, on many Linux systems, writing small files don’t use a lot of disk I/O because they sit in the file system cache.
Of course, any
tmpfsfile system loses all its content at every reboot, so you don’t want to keep important unrecoverable data inside.