When working with large data (like images) it is wise to keep everything in series (every time a node has more than one wire attached to its output, the msg
is cloned. This can be REALLY expensive when working with images).
Next, you dont NEED to join - image tools can output to any msg
property you desire. In the example below, i outputed image 1 to msg.image1
and then the 2nd to msg.image2
- this means they are both in the message at the same time and there is no need to fork and join.
Flow...
[{"id":"0783c6a62c16d275","type":"inject","z":"b49d85e0d81629eb","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":120,"y":140,"wires":[["38c022b02257c376"]]},{"id":"58d41be39510885c","type":"function","z":"b49d85e0d81629eb","name":"","func":"msg.payload = Jimp.diff(msg.image1, msg.image2, .1);\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[{"var":"Jimp","module":"jimp"}],"x":780,"y":140,"wires":[["cfd47baf86adbe7d"]]},{"id":"fce2138939e629ab","type":"debug","z":"b49d85e0d81629eb","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"true","targetType":"full","statusVal":"\"Diff: \" & (msg.payload.percent * 100) & \"%\"","statusType":"jsonata","x":970,"y":220,"wires":[]},{"id":"3cb9b3902dfd9169","type":"comment","z":"b49d85e0d81629eb","name":"Bezugsbild","info":"","x":320,"y":100,"wires":[]},{"id":"daa04a5959ad38d7","type":"comment","z":"b49d85e0d81629eb","name":"aktuelles Bild","info":"","x":550,"y":100,"wires":[]},{"id":"5e40198abd21b82f","type":"comment","z":"b49d85e0d81629eb","name":"vergleicher","info":"","x":780,"y":100,"wires":[]},{"id":"38c022b02257c376","type":"jimp-image","z":"b49d85e0d81629eb","name":"image1","data":"https://www.bmel.de/SharedDocs/Bilder/DE/_Tiere/Haus-Zootiere/tierschutz-hunde.jpg?__blob=wide&v=3","dataType":"str","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":300,"y":140,"wires":[["a5f8b8a14fc658f5"]]},{"id":"808dc2eb855ebf72","type":"jimp-image","z":"b49d85e0d81629eb","name":"image2","data":"https://image.geo.de/34423086/t/u8/v1/w1440/r0/-/katze-as-97589769.jpg","dataType":"str","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":540,"y":140,"wires":[["5b526e874ddc6c7b"]]},{"id":"a5f8b8a14fc658f5","type":"image viewer","z":"b49d85e0d81629eb","name":"","width":"120","data":"image1","dataType":"msg","active":true,"x":290,"y":220,"wires":[["808dc2eb855ebf72"]]},{"id":"5b526e874ddc6c7b","type":"image viewer","z":"b49d85e0d81629eb","name":"","width":"120","data":"image2","dataType":"msg","active":true,"x":530,"y":220,"wires":[["58d41be39510885c"]]},{"id":"cfd47baf86adbe7d","type":"image viewer","z":"b49d85e0d81629eb","name":"","width":160,"data":"payload.image","dataType":"msg","active":true,"x":770,"y":220,"wires":[["fce2138939e629ab"]]}]