Stitch together several image tiles

I have a flow that retrieves weather map image tiles. I can use node-red-contrib-image-tools to show the tiles side by side. I would like to stitch together these tiles into a single image.

Maybe create a blank image of the desired size and then composite the tiles onto it?

exactly yes.

[{"id":"9435702b.6e1c4","type":"inject","z":"4b3f21a3.ba434","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":800,"y":2460,"wires":[["dd869b1.00bf368"]]},{"id":"dd869b1.00bf368","type":"http request","z":"4b3f21a3.ba434","name":"","method":"GET","ret":"bin","paytoqs":"ignore","url":"https://picsum.photos/200/300","tls":"","persist":false,"proxy":"","authType":"","x":800,"y":2520,"wires":[["953d7669.9cbf78"]]},{"id":"6bdbca50.679ed4","type":"http request","z":"4b3f21a3.ba434","name":"","method":"GET","ret":"bin","paytoqs":"ignore","url":"https://picsum.photos/200/300","tls":"","persist":false,"proxy":"","authType":"","x":810,"y":2720,"wires":[["dbb82ce3.015fd"]]},{"id":"953d7669.9cbf78","type":"jimp-image","z":"4b3f21a3.ba434","name":"image1","data":"payload","dataType":"msg","ret":"img","parameter1":"","parameter1Type":"msg","parameter2":"","parameter2Type":"msg","parameter3":"","parameter3Type":"msg","parameter4":"","parameter4Type":"msg","parameter5":"","parameter5Type":"msg","parameter6":"","parameter6Type":"msg","parameter7":"","parameter7Type":"msg","parameter8":"","parameter8Type":"msg","sendProperty":"image1","sendPropertyType":"msg","parameterCount":0,"jimpFunction":"none","selectedJimpFunction":{"name":"none","fn":"none","description":"Just loads the image.","parameters":[]},"x":970,"y":2520,"wires":[["837b82da.e1ddf"]]},{"id":"837b82da.e1ddf","type":"image viewer","z":"4b3f21a3.ba434","name":"","width":"80","data":"payload","dataType":"msg","x":1130,"y":2520,"wires":[["9a147be1.7d1af8"]]},{"id":"dbb82ce3.015fd","type":"jimp-image","z":"4b3f21a3.ba434","name":"image2","data":"payload","dataType":"msg","ret":"img","parameter1":"","parameter1Type":"msg","parameter2":"","parameter2Type":"msg","parameter3":"","parameter3Type":"msg","parameter4":"","parameter4Type":"msg","parameter5":"","parameter5Type":"msg","parameter6":"","parameter6Type":"msg","parameter7":"","parameter7Type":"msg","parameter8":"","parameter8Type":"msg","sendProperty":"image2","sendPropertyType":"msg","parameterCount":0,"jimpFunction":"none","selectedJimpFunction":{"name":"none","fn":"none","description":"Just loads the image.","parameters":[]},"x":980,"y":2720,"wires":[["7a25ce49.788e3"]]},{"id":"7a25ce49.788e3","type":"image viewer","z":"4b3f21a3.ba434","name":"","width":"80","data":"payload","dataType":"msg","x":1130,"y":2720,"wires":[["9f823f06.0719c"]]},{"id":"9a147be1.7d1af8","type":"function","z":"4b3f21a3.ba434","name":"get sizes","func":"msg.width1 = msg.imageInfo.width;\nmsg.height1 = msg.imageInfo.height;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1320,"y":2520,"wires":[["6bdbca50.679ed4"]]},{"id":"9f823f06.0719c","type":"function","z":"4b3f21a3.ba434","name":"get sizes","func":"msg.width2 = msg.imageInfo.width;\nmsg.height2 = msg.imageInfo.height;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1320,"y":2720,"wires":[["ad0be53d.59eba8"]]},{"id":"ad0be53d.59eba8","type":"function","z":"4b3f21a3.ba434","name":"new img params","func":"msg.width3 = msg.width1 + msg.width2;\nmsg.height3 = Math.max(msg.height1, + msg.height2);\nmsg.payload = {w: msg.width3, h: msg.height3}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":820,"y":2920,"wires":[["8c0d7a05.bcb2f8"]]},{"id":"8c0d7a05.bcb2f8","type":"jimp-image","z":"4b3f21a3.ba434","name":"image3","data":"payload","dataType":"msg","ret":"img","parameter1":"","parameter1Type":"msg","parameter2":"","parameter2Type":"msg","parameter3":"","parameter3Type":"msg","parameter4":"","parameter4Type":"msg","parameter5":"","parameter5Type":"msg","parameter6":"","parameter6Type":"msg","parameter7":"","parameter7Type":"msg","parameter8":"","parameter8Type":"msg","sendProperty":"image3","sendPropertyType":"msg","parameterCount":0,"jimpFunction":"none","selectedJimpFunction":{"name":"none","fn":"none","description":"Just loads the image.","parameters":[]},"x":980,"y":2920,"wires":[["9917d983.f4d368"]]},{"id":"9917d983.f4d368","type":"jimp-image","z":"4b3f21a3.ba434","name":"blit image1","data":"image3","dataType":"msg","ret":"img","parameter1":"image1","parameter1Type":"msg","parameter2":"0","parameter2Type":"num","parameter3":"0","parameter3Type":"num","parameter4":"0","parameter4Type":"num","parameter5":"0","parameter5Type":"num","parameter6":"width1","parameter6Type":"msg","parameter7":"height1","parameter7Type":"msg","parameter8":"","parameter8Type":"msg","sendProperty":"image3","sendPropertyType":"msg","parameterCount":7,"jimpFunction":"blit","selectedJimpFunction":{"name":"blit","fn":"blit","description":"blit the image with another Jimp image at x, y, optionally cropped","parameters":[{"name":"src","type":"","required":true,"hint":"the source image (a Jimp instance)","defaultType":"msg","defaultValue":"payload"},{"name":"x","type":"num","required":true,"hint":"the x position to blit the image"},{"name":"y","type":"num","required":true,"hint":"the y position to blit the image"},{"name":"srcx","type":"num","required":false,"hint":"the x position from which to crop the source image"},{"name":"srcy","type":"num","required":false,"hint":"the y position from which to crop the source image"},{"name":"srcw","type":"num","required":false,"hint":"the width to which to crop the source image"},{"name":"srch","type":"num","required":false,"hint":"the height to which to crop the source image"}]},"x":1150,"y":2920,"wires":[["d9d820c9.04114"]]},{"id":"2879d916.ae7e46","type":"image viewer","z":"4b3f21a3.ba434","name":"","width":"140","data":"image3","dataType":"msg","x":1490,"y":2920,"wires":[[]]},{"id":"d9d820c9.04114","type":"jimp-image","z":"4b3f21a3.ba434","name":"blit image2","data":"image3","dataType":"msg","ret":"img","parameter1":"image2","parameter1Type":"msg","parameter2":"width1","parameter2Type":"msg","parameter3":"0","parameter3Type":"num","parameter4":"0","parameter4Type":"num","parameter5":"0","parameter5Type":"num","parameter6":"width2","parameter6Type":"msg","parameter7":"height2","parameter7Type":"msg","parameter8":"","parameter8Type":"msg","sendProperty":"image3","sendPropertyType":"msg","parameterCount":7,"jimpFunction":"blit","selectedJimpFunction":{"name":"blit","fn":"blit","description":"blit the image with another Jimp image at x, y, optionally cropped","parameters":[{"name":"src","type":"","required":true,"hint":"the source image (a Jimp instance)","defaultType":"msg","defaultValue":"payload"},{"name":"x","type":"num","required":true,"hint":"the x position to blit the image"},{"name":"y","type":"num","required":true,"hint":"the y position to blit the image"},{"name":"srcx","type":"num","required":false,"hint":"the x position from which to crop the source image"},{"name":"srcy","type":"num","required":false,"hint":"the y position from which to crop the source image"},{"name":"srcw","type":"num","required":false,"hint":"the width to which to crop the source image"},{"name":"srch","type":"num","required":false,"hint":"the height to which to crop the source image"}]},"x":1330,"y":2920,"wires":[["2879d916.ae7e46"]]}]
2 Likes

Excellent - That worked! Thanks
Here's 3 hours compressed into a few seconds of North America cooling down this evening.

3 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.