# Dynamically setting property when merging 2 images

**URL:** <https://discourse.nodered.org/t/dynamically-setting-property-when-merging-2-images/83042>\
**Category:** General\
**Created:** [20 November 2023 22:03 UTC](https://discourse.nodered.org/t/dynamically-setting-property-when-merging-2-images/83042 "2023-11-20T22:03:47Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [20 November 2023 22:03 UTC](https://discourse.nodered.org/t/dynamically-setting-property-when-merging-2-images/83042/1 "2023-11-20T22:03:47Z")

</div>

@Steve-Mcl

I'm trying to bargraph indicator using your image node

I'm wanting to set srch from outside the node config

how do I do that as this isn';t working for me

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/9/b9c48fbe28ecaf069a81b6f7fb62981b9f56005f.png)

```auto
[{"id":"799ae55bf5980e54","type":"inject","z":"a5bac9c2d0415401","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":120,"y":160,"wires":[["12d88431d0ad0da9","d41e42dda10fd500"]]},{"id":"b498314ed6d950fe","type":"jimp-image","z":"a5bac9c2d0415401","name":"","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":"payload","sendPropertyType":"msg","parameterCount":0,"jimpFunction":"none","selectedJimpFunction":{"name":"none","fn":"none","description":"Just loads the image.","parameters":[]},"x":470,"y":160,"wires":[["d78b06e0d3df2fe5","d12598a09c7ea102"]]},{"id":"d78b06e0d3df2fe5","type":"image viewer","z":"a5bac9c2d0415401","name":"","width":160,"data":"payload","dataType":"msg","active":true,"x":470,"y":200,"wires":[[]]},{"id":"de4b49a7f50d1626","type":"jimp-image","z":"a5bac9c2d0415401","name":"","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":"payload","sendPropertyType":"msg","parameterCount":0,"jimpFunction":"none","selectedJimpFunction":{"name":"none","fn":"none","description":"Just loads the image.","parameters":[]},"x":430,"y":260,"wires":[["0782e5ff28651de2","d12598a09c7ea102"]]},{"id":"0782e5ff28651de2","type":"image viewer","z":"a5bac9c2d0415401","name":"","width":160,"data":"payload","dataType":"msg","active":true,"x":430,"y":300,"wires":[[]]},{"id":"987f3183c36b0946","type":"jimp-image","z":"a5bac9c2d0415401","name":"Merge","data":"payload.green","dataType":"msg","ret":"img","parameter1":"payload.red","parameter1Type":"msg","parameter2":"0","parameter2Type":"num","parameter3":"0","parameter3Type":"num","parameter4":"0","parameter4Type":"num","parameter5":"0","parameter5Type":"num","parameter6":"160","parameter6Type":"num","parameter7":"50","parameter7Type":"num","parameter8":"","parameter8Type":"","sendProperty":"payload","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":990,"y":160,"wires":[["fcd9f7faebfcfd30"]],"icon":"font-awesome/fa-image"},{"id":"fcd9f7faebfcfd30","type":"image viewer","z":"a5bac9c2d0415401","name":"","width":160,"data":"payload","dataType":"msg","active":true,"x":1130,"y":160,"wires":[[]]},{"id":"12d88431d0ad0da9","type":"change","z":"a5bac9c2d0415401","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"w\":160,\"h\":100,\"background\":\"#FF0000\"}","tot":"json"},{"t":"set","p":"topic","pt":"msg","to":"red","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":300,"y":160,"wires":[["b498314ed6d950fe"]]},{"id":"d41e42dda10fd500","type":"change","z":"a5bac9c2d0415401","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"w\":160,\"h\":100,\"background\":\"#00FF00\"}","tot":"json"},{"t":"set","p":"topic","pt":"msg","to":"green","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":280,"y":260,"wires":[["de4b49a7f50d1626"]]},{"id":"c70e526d0d6f25c0","type":"debug","z":"a5bac9c2d0415401","name":"Look in the available properties in the debug side bar","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":940,"y":360,"wires":[]},{"id":"d12598a09c7ea102","type":"join","z":"a5bac9c2d0415401","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"num","reduceFixup":"","x":630,"y":160,"wires":[["c70e526d0d6f25c0","31c61d8a86547c70"]]},{"id":"31c61d8a86547c70","type":"change","z":"a5bac9c2d0415401","name":"","rules":[{"t":"set","p":"parameters","pt":"msg","to":"[0,0,0,0,160,80]","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":820,"y":160,"wires":[["987f3183c36b0946"]]}]

```

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [20 November 2023 22:07 UTC](https://discourse.nodered.org/t/dynamically-setting-property-when-merging-2-images/83042/2 "2023-11-20T22:07:01Z")

</div>

> [@cymplecy](#):
>
> bar a bar indicator

?

> [@cymplecy](#):
>
> I'm wanting to set srch from outside the node config

?

Not following Simon sorry.

Can you clarify pls? Perhaps showing a mock image of what you're trying to achieve with some annotations would help?

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [20 November 2023 22:11 UTC](https://discourse.nodered.org/t/dynamically-setting-property-when-merging-2-images/83042/3 "2023-11-20T22:11:40Z")

</div>

The last image after the merge shows 50/50 red/green as set in the merge node srch parameter

how can I vary that from outside the node config?

Trying to make a poor mans bargraph indicator 🙂

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [20 November 2023 22:13 UTC](https://discourse.nodered.org/t/dynamically-setting-property-when-merging-2-images/83042/4 "2023-11-20T22:13:05Z")

</div>

No urgent reply needed 🙂

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [20 November 2023 23:25 UTC](https://discourse.nodered.org/t/dynamically-setting-property-when-merging-2-images/83042/5 "2023-11-20T23:25:40Z")

</div>

Something like this?

![chrome_LYPo4yQPFO](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/2/d2bdf6d2b496562fd8f25c56cf7b9e344a48825c.gif)

```auto
[{"id":"7d8460a8e7cc5092","type":"inject","z":"6e46a349d744ceaa","name":"srch 10","props":[{"p":"payload"},{"p":"srch","v":"10","vt":"num"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":610,"y":2460,"wires":[["4d6b8738aa3dd8f3"]]},{"id":"4c0a3e3afe32b996","type":"image viewer","z":"6e46a349d744ceaa","name":"","width":"80","data":"payload","dataType":"msg","active":true,"x":1270,"y":2660,"wires":[[]]},{"id":"9aa55479a8a806ea","type":"inject","z":"6e46a349d744ceaa","name":"srch 50","props":[{"p":"payload"},{"p":"srch","v":"50","vt":"num"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":610,"y":2500,"wires":[["4d6b8738aa3dd8f3"]]},{"id":"aeed62794d9e5a22","type":"inject","z":"6e46a349d744ceaa","name":"srch 90","props":[{"p":"payload"},{"p":"srch","v":"90","vt":"num"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":610,"y":2540,"wires":[["4d6b8738aa3dd8f3"]]},{"id":"8a5acac070aadc19","type":"jimp-image","z":"6e46a349d744ceaa","name":"Merge msg.red + msg.green","data":"green","dataType":"msg","ret":"img","parameter1":"red","parameter1Type":"msg","parameter2":"0","parameter2Type":"num","parameter3":"0","parameter3Type":"num","parameter4":"0","parameter4Type":"num","parameter5":"0","parameter5Type":"num","parameter6":"160","parameter6Type":"num","parameter7":"srch","parameter7Type":"msg","parameter8":"","parameter8Type":"","sendProperty":"payload","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":880,"y":2660,"wires":[["4c0a3e3afe32b996"]],"icon":"font-awesome/fa-image"},{"id":"46c730c1f55f238d","type":"jimp-image","z":"6e46a349d744ceaa","name":"Create top image","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":"red","sendPropertyType":"msg","parameterCount":0,"jimpFunction":"none","selectedJimpFunction":{"name":"none","fn":"none","description":"Just loads the image.","parameters":[]},"x":1090,"y":2500,"wires":[["47f691d411e667ad"]]},{"id":"3bed55b6569bb12a","type":"change","z":"6e46a349d744ceaa","name":"setup top","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"w\":160,\"h\":100,\"background\":\"#FF0000\"}","tot":"json"},{"t":"set","p":"payload.background","pt":"msg","to":"tc","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":860,"y":2500,"wires":[["46c730c1f55f238d"]]},{"id":"47f691d411e667ad","type":"image viewer","z":"6e46a349d744ceaa","name":"","width":"40","data":"red","dataType":"msg","active":true,"x":1270,"y":2500,"wires":[["9943c6baa3eab5db"]]},{"id":"098b32704a7ba2eb","type":"jimp-image","z":"6e46a349d744ceaa","name":"Create base image","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":"green","sendPropertyType":"msg","parameterCount":0,"jimpFunction":"none","selectedJimpFunction":{"name":"none","fn":"none","description":"Just loads the image.","parameters":[]},"x":1090,"y":2580,"wires":[["33ab7893555acb37"]]},{"id":"33ab7893555acb37","type":"image viewer","z":"6e46a349d744ceaa","name":"","width":"40","data":"green","dataType":"msg","active":true,"x":1270,"y":2580,"wires":[["8a5acac070aadc19"]]},{"id":"9943c6baa3eab5db","type":"change","z":"6e46a349d744ceaa","name":"setup base","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"w\":160,\"h\":100,\"background\":\"#00FF00\"}","tot":"json"},{"t":"set","p":"payload.background","pt":"msg","to":"bc","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":870,"y":2580,"wires":[["098b32704a7ba2eb"]]},{"id":"6dcfc6555a908f58","type":"change","z":"6e46a349d744ceaa","name":"","rules":[{"t":"set","p":"bc","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1270,"y":2360,"wires":[[]]},{"id":"3e70c84616046a68","type":"inject","z":"6e46a349d744ceaa","name":"set base colour blue","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"#0000FF","payloadType":"str","x":1050,"y":2340,"wires":[["6dcfc6555a908f58"]]},{"id":"324693771e1603db","type":"inject","z":"6e46a349d744ceaa","name":"set base colour green","props":[{"p":"payload"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"#00FF00","payloadType":"str","x":1060,"y":2380,"wires":[["6dcfc6555a908f58"]]},{"id":"4cb31650492d4b80","type":"change","z":"6e46a349d744ceaa","name":"","rules":[{"t":"set","p":"tc","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":840,"y":2360,"wires":[[]]},{"id":"4cd65c749896446e","type":"inject","z":"6e46a349d744ceaa","name":"set top colour red","props":[{"p":"payload"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"#FF0000","payloadType":"str","x":650,"y":2340,"wires":[["4cb31650492d4b80"]]},{"id":"430af178539fe05b","type":"inject","z":"6e46a349d744ceaa","name":"set top colour silver","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"#d1d1d1","payloadType":"str","x":650,"y":2380,"wires":[["4cb31650492d4b80"]]},{"id":"4d6b8738aa3dd8f3","type":"junction","z":"6e46a349d744ceaa","x":780,"y":2500,"wires":[["3bed55b6569bb12a"]]}]

```

Key to working with images in Node-RED is to minimise (completely eliminate where possible) branches as each wire branch creates an expensive clone of the image data.

Look at my flow, see how i utilise properties in the msg to store the top and base images and carry them along a single flow until the last node.

That's why the image viewer node has an output. I know its not pretty but the larger the image, the more it becomes important.

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [21 November 2023 06:36 UTC](https://discourse.nodered.org/t/dynamically-setting-property-when-merging-2-images/83042/6 "2023-11-21T06:36:20Z")

</div>

Just going thru your flow one step at a time 🙂

Why is msg.payload.background still set to "#FF0000" at this point?

Why isn't it the saved flow.tc image?

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/2/a22a264a3c7c0058b47d6f87bf2ddc574618811c.png)

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [21 November 2023 07:00 UTC](https://discourse.nodered.org/t/dynamically-setting-property-when-merging-2-images/83042/7 "2023-11-21T07:00:15Z")

</div>

> [@cymplecy](#):
>
> Why is msg.payload.background still set to "#FF0000" at this point?

I don't know what flow.tc is set to in your context so I can't comment.

Does it all work for you as it did for me in the demo gif?

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [21 November 2023 07:04 UTC](https://discourse.nodered.org/t/dynamically-setting-property-when-merging-2-images/83042/8 "2023-11-21T07:04:26Z")

</div>

Sorry for noise ! Usual PEBKAC at this end

It works lovely - I was just trying to go thru one step at a time to make sure I new what was going on and failed at my 1st step

I'm going to blame the fact that I had a bad nights sleep and its early in the morning 🙂

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [21 November 2023 07:14 UTC](https://discourse.nodered.org/t/dynamically-setting-property-when-merging-2-images/83042/9 "2023-11-21T07:14:58Z")

</div>

And I now see my error in my orig - wasn't setting srch (and the using in merge) correctly

Do going back to your point about memory usuage

Instinctively, I'd now write your flow as

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/3/93c84dcbf375cd7f7318c88f4f605ac36a2ccb5c.png)

to avoid one of the NR gods having apoplexy at a wire sticking thru an output switch 🙂

is there still a penalty if the viewer switch is off?

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [21 November 2023 07:30 UTC](https://discourse.nodered.org/t/dynamically-setting-property-when-merging-2-images/83042/10 "2023-11-21T07:30:08Z")

</div>

> [@cymplecy](#):
>
> is there still a penalty if the viewer switch is off?

Yes. The message is still transmitted down the wire.

And this conversation now dovetails nicely into another thread...

> [@Custom node appearance and event handlers. Proof on concept: Inline Gauge](https://discourse.nodered.org/t/custom-node-appearance-and-event-handlers-proof-on-concept-inline-gauge/83001/12):
>
> I would love ❤ to see nodes have more capabilities including better UI when having both input/output AND buttons.
> 
> Clearly, the current design makes this look awful (wires passing through the buttons - yuk) but I'd love to see it addressed with a UI refresh.
> 
> One way of supporting this would be a node redesign (😱) with the buttons moved internal to the node body, permitting input/output wires to connect to the edges

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [21 November 2023 07:33 UTC](https://discourse.nodered.org/t/dynamically-setting-property-when-merging-2-images/83042/11 "2023-11-21T07:33:27Z")

</div>

> [@cymplecy](#):
>
> to avoid one of the NR gods having apoplexy at a wire sticking thru an output switch

Does this gods name rhyme with "wave" 😉

@dceejay

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [21 November 2023 07:40 UTC](https://discourse.nodered.org/t/dynamically-setting-property-when-merging-2-images/83042/12 "2023-11-21T07:40:18Z")

</div>

> [@Steve-Mcl](#):
>
> And this conversation now dovetails nicely into another thread...

That thread is what made me try this - to come up with a method of having a bargraph "guage" but using your existing viewer node 🙂

---

<div class="post-metadata">

**Author:** ![hotNipi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hotnipi/32/383_2.png) [@hotNipi](https://discourse.nodered.org/u/hotNipi)\
**Post date:** [21 November 2023 08:07 UTC](https://discourse.nodered.org/t/dynamically-setting-property-when-merging-2-images/83042/13 "2023-11-21T08:07:30Z")

</div>

Without breaking any rules ..

```auto
[{"id":"463a4a791ee10b35","type":"inject","z":"d418230481b87e35","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"1","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":230,"y":1080,"wires":[["c061dffdc7f953c0"]]},{"id":"c061dffdc7f953c0","type":"random","z":"d418230481b87e35","name":"","low":1,"high":"100","inte":"true","property":"payload","x":380,"y":1080,"wires":[["02081e637f75357b"]]},{"id":"02081e637f75357b","type":"function","z":"d418230481b87e35","name":"level me","func":"const min = 0\nconst max = 100\n\nconst val = msg.payload\nlet result = ''\n\nfor(let i = 0;i<20;++i){\n if(i<val/5){\n result += '|'\n }\n else{\n result += ' '\n }\n}\nresult += \" \"+val\n\nnode.status({fill:'', shape:'ring' , text:result})\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":520,"y":1080,"wires":[[]]}]

```

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/0/30fdbb6e06df3c9d1e5bf08b6fc5045ade201edf.png)

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [21 November 2023 11:06 UTC](https://discourse.nodered.org/t/dynamically-setting-property-when-merging-2-images/83042/14 "2023-11-21T11:06:12Z")

</div>

And don't they look lovely working together 🙂  
 ![gauge](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/5/c5e55a2a07ca5aab111e70c38d5114bf92d6d284.gif)

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [21 November 2023 11:22 UTC](https://discourse.nodered.org/t/dynamically-setting-property-when-merging-2-images/83042/15 "2023-11-21T11:22:21Z")

</div>

> [@cymplecy](#):
>
> to avoid one of the NR gods having apoplexy at a wire sticking thru an output switch

> [@Steve-Mcl](#):
>
> Does this gods name rhyme with "wave" 😉

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/a/aa8120c07d52b5635aa9b575faec90bbfe5cd812.jpeg)

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [21 November 2023 11:24 UTC](https://discourse.nodered.org/t/dynamically-setting-property-when-merging-2-images/83042/16 "2023-11-21T11:24:21Z")

</div>

Yes they do

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [21 November 2023 22:00 UTC](https://discourse.nodered.org/t/dynamically-setting-property-when-merging-2-images/83042/17 "2023-11-21T22:00:31Z")

</div>

@cymplecy Don't forget you can also use unicode chars... [Unicode Block “Block Elements”](https://www.compart.com/en/unicode/block/U+2580)

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/1/d133e38871ec6595b96f139def40a1d1552d098c.png)

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [21 November 2023 23:21 UTC](https://discourse.nodered.org/t/dynamically-setting-property-when-merging-2-images/83042/18 "2023-11-21T23:21:39Z")

</div>

And you can print the value over image too

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [5 December 2023 23:21 UTC](https://discourse.nodered.org/t/dynamically-setting-property-when-merging-2-images/83042/19 "2023-12-05T23:21:41Z")

</div>

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