Reputation: 20138
I have some small images that tiled together make a fullsize image. The tiles are saved on the server. I would like to stitch the tiles together in the right position and create 1 image file on disk made up of all the tile files. How can I do this in nodejs?
Thanks
Upvotes: 2
Views: 1144
Reputation: 40582
Since node.js doesn't have a graphics editing suite, your best path would be to
You could call an external script, using java, using php, or the language you feel most comfortable hacking with.
There's plenty of material on how to run a script from node.js, so I won't mess around with that here.
However, I would suggest that you pass a temporary filename as an argument to the script, then when it finishes executing, go get that file rather than trying to read back the binary as a return value or something equally convoluted.
Upvotes: 0
Reputation: 106017
Your best bet is probably to invoke a tool like ImageMagick, which has a montage
command that does exactly what you're looking for.
This would be fairly straightforward to implement yourself, but I see that this fork of node-imagemagick has montage
support.
Upvotes: 3