# How to manage the image-output / image-tools node conflict (split topic)

**URL:** <https://discourse.nodered.org/t/how-to-manage-the-image-output-image-tools-node-conflict-split-topic/24122>\
**Category:** General\
**Created:** [2 April 2020 18:32 UTC](https://discourse.nodered.org/t/how-to-manage-the-image-output-image-tools-node-conflict-split-topic/24122 "2020-04-02T18:32:09Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [2 April 2020 18:32 UTC](https://discourse.nodered.org/t/how-to-manage-the-image-output-image-tools-node-conflict-split-topic/24122/1 "2020-04-02T18:32:09Z")

</div>

> [@Object Detection using node-red-contrib-tfjs-coco-ssd](https://discourse.nodered.org/t/object-detection-using-node-red-contrib-tfjs-coco-ssd/22931/95):
>
> Is the other separate image preview node installed? (Might conflict)

Hey Steve,  
It indeeds gives conflicts because you have used in your clone the same node identifier as the original node.  
BTW a few months ago, @dceejay and I have been pimping the original _ **node-red-contrib-image-output** _ node quite heavily:

- it also accepts jimp images
- it automatically resizes images to the size they will be displayed, to reduce data traffic
- it has a button (similar to the debug node) to pause the image streaming at server side
- ...

But it is indeed a pity that now both nodes can't be installed together, because I want to use your image-tool nodes and the original image-output node. But don't know how to achieve that...

---

<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:** [2 April 2020 18:54 UTC](https://discourse.nodered.org/t/how-to-manage-the-image-output-image-tools-node-conflict-split-topic/24122/2 "2020-04-02T18:54:59Z")

</div>

Hi Bart, i spent a lot of time mulling over how best to handle this when I included it in image-tools (I discussed it on here)

In the end, after much agonising, I decided to keep it inside as it handled a number of things the original didnt e.g. it didnt work on IE11, didnt know what to do with a jimp image, couldnt handle certain base64 images without mime specifier etc etc. I did ask for advice (like how to support handling a jimp image without the lib installed) etc but information (and my knowledge at the time) were not forth coming - it ended in this situation.

I think another part of my logic was that if you are doing image modification - you get a built in viewer.

With my hindsight glasses on, I should have gave it a different name (this was written before I understood those types of implications)

If I remove it now & users update, then it (kinda) breaks what they have.

HOWEVER...  
If we come together and combine the capabilities of the two, I would consider removing or renaming the internal image viewer - thoughts on how I would mitigate disruption to existing users Major version number change? some means of detecting and changing existing old name image-viewer nodes? optional dependency to other node?

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [2 April 2020 19:35 UTC](https://discourse.nodered.org/t/how-to-manage-the-image-output-image-tools-node-conflict-split-topic/24122/3 "2020-04-02T19:35:18Z")

</div>

> [@Steve-Mcl](#):
>
> combine the capabilities of the two

Yes I think we definitely should do that in the near future ( in a separate discussion), at least if @dceejay agrees. Because he has become the new master of Riku's image-output node...

---

<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:** [2 April 2020 21:25 UTC](https://discourse.nodered.org/t/how-to-manage-the-image-output-image-tools-node-conflict-split-topic/24122/4 "2020-04-02T21:25:20Z")

</div>

Yes they need to be either de-conflicted or merged. I don't think I'm the master but do have the power to update it. I think it should be a stand alone node (that can be required by Steve's package of course) - so users that don't need it all can just use it stand-alone. I don't mind whomever wants to take on the task of blending them. Must admit I've not used Steve's so I don't know how much it differs.

---

<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:** [3 April 2020 01:24 UTC](https://discourse.nodered.org/t/how-to-manage-the-image-output-image-tools-node-conflict-split-topic/24122/5 "2020-04-03T01:24:40Z")

</div>

If ok with everyone, perhaps we can continue this here?

---

<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:** [9 April 2020 14:31 UTC](https://discourse.nodered.org/t/how-to-manage-the-image-output-image-tools-node-conflict-split-topic/24122/6 "2020-04-09T14:31:56Z")

</div>

Hi @BartButenaers / @dceejay , so as discussed, I have been evaluating both image viewer nodes in both contribs `-image-tools` and `-image-output` with a view to removing the built in viewer in favour of the stand alone node.

### Rough comparison...

- `image-output` uses `jimp-compact`, `image-tools` uses `jimp`

- `-image-tools` does not have an output enable button

- `-image-output` has no pass though (no output pin), (`-image-tools` has a pass though for inline / chained operations (output pin))

- `-image-output` doesn't work with a full data URL ([spec](https://tools.ietf.org/html/rfc2397) / [mdn](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs)) e.g. `data:[<mediatype>][;base64],<data>`

- `-image-tools` viewer accepts everything `image-output` does + filename + Image URL + (complete) data URLs

- `image-output` resizes image at server-side to reduce traffic back to node-red editor

_These are partly the reasons I initially added the viewer (I'll try to find original conversation for reference - if necessary) but mostly the `image-output` did not have `Jimp` as a dependency at the time of development - and seemed a lot to ask devs to add_

### Demo...

Here's a demo to try and put the above words into a picture...  
note the deliberate typo in the image - base62 🙄

 ![8BtuIc0YyG](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/2/c2df0cb2127ca3741bd9731705b1e46199d13cf2.gif)

What are your thoughts on aligning our 2 viewer nodes in order for me to consider removing the internal viewer?

### NOTES

I have modified the original image viewer node to make this demo work (some bug fixes in image-tools viewer I happily happened upon!) + there was another conflict I had to resolve before I could test these side-by-side (both image viewers subscribed to the same comm (`RED.comms.subscribe('image'...`) so events were occurring twice at client side.

Image URL issue...

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

Data URL issue...

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

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [10 April 2020 19:58 UTC](https://discourse.nodered.org/t/how-to-manage-the-image-output-image-tools-node-conflict-split-topic/24122/7 "2020-04-10T19:58:09Z")

</div>

Hey Steve,

Thanks for the time you have spent on comparing both nodes!  
Looks like a very professional comparison!!

- _ **Jimp vs Jimp-compact** _: you are completely right that this library indeed might stop following jimp in the future. However the viewer only needs the _most basic_ jimp functionality: we only need to be able to resize and load a Jimp object. All other (new) Jimp functionality won't be needed for the viewer, so don't think it is a problem if that gets upgraded in the future. Is that correct?
- _ **output enable button** _: that is one of my favorite features, because now I can keep my image viewer nodes in the flow, even when I don't need them at the moment. No data will be transferred anyway ...
- _ **no output pin** _: Oh what a bummer... That is indeed VERY useful to avoid cloning. However I don't think this can be combined with the output enable button. Damn. _Don't know a solution for this_ 🙄
- _ **full data url** _ and _ **missing mime type** _: Ok that indeed should be fixed.

Am I correct that the output pin is the major bottleneck to be able to merge both nodes?  
Or do you see other major problems to merge them?

---

<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:** [10 April 2020 20:18 UTC](https://discourse.nodered.org/t/how-to-manage-the-image-output-image-tools-node-conflict-split-topic/24122/8 "2020-04-10T20:18:48Z")

</div>

> [@BartButenaers](#):
>
> _ **Jimp vs Jimp-compact** _ : you are completely right that this library indeed might stop following jimp in the future. However the viewer only needs the _most basic_ jimp functionality: we only need to be able to resize and load a Jimp object. All other (new) Jimp functionality won't be needed for the viewer, so don't think it is a problem if that gets upgraded in the future. Is that correct?

This is true but its not the problem. If I were to switch `image-tools` to jimp-compact and jimp-compact fell behind Jimp, I would want to switch back to original Jimp - so I prefer to keep `image-tools` with original Jimp version.

That basically means if a user has both `image-tools` and `image-output` -AND- we dont use same library, then the installation is larger (`jimp` and `jimp-compact` wont be de-duplicated by NPM)

Not a huge problem.

> [@BartButenaers](#):
>
> _ **output enable button** _ : that is one of my favorite features, because now I can keep my image viewer nodes in the flow, even when I don't need them at the moment. No data will be transferred anyway ...

I agree - a good feature.

> [@BartButenaers](#):
>
> _ **no output pin** _ : Oh what a bummer... That is indeed VERY useful to avoid cloning. However I don't think this can be combined with the output enable button. Damn. _Don't know a solution for this_ 🙄

Actually, you can have a button AND an output (it isn't pretty - but it works)

 ![XHyNZdVF6E](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/7/37555c42dd8ac0b3bfab94d50b0eaac6a1a0b872.gif)

> [@BartButenaers](#):
>
> _ **full data url** _ and _ **missing mime type** _ : Ok that indeed should be fixed.

Yeah, including Image URL

> [@BartButenaers](#):
>
> Am I correct that the output pin is the major bottleneck to be able to merge both nodes?  
> Or do you see other major problems to merge them?

Current hurdles for me are...

1. Must be able to handle full Data URLs
2. Must be able to handle full Image URLs (you get this for free when you fix No.1)
3. Must be able to handle filenames (easy now you have Jimp)  
_(All of this is handled in image-tools if you wish to save on dev time)_

Current sticky point (but not a problem for me personnaly)

- I greatly prefer NOT to switch to jimp-compact so either `image-output` changes to `jimp` OR we do nothing (NPM doesnt dedupe, user has larger install - but everything continues to work)

---

<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:** [10 April 2020 20:56 UTC](https://discourse.nodered.org/t/how-to-manage-the-image-output-image-tools-node-conflict-split-topic/24122/9 "2020-04-10T20:56:30Z")

</div>

Steve thanks for the great analysis work - great summary.

when installed - jimp-compact is 482k... vs jimp is 24MB... I think I know which I prefer for something I don't use every day. Smaller every time. Re getting behind... what are you thinking may be needed ?

wire and button ... uuuurgh - please god no... I would get it banned if you do that... (OK maybe not - but there will be words!!!) . You could have an option instead... if configured in passthrough mode then remove the button and add the pin... and vice versa.

Re full data url and missing mime type - I guess I 'm not quite up to speed on the subtlety of that - but I'm sure you guys can enlighten me or Bart can fix it 😉

I think we have managed to stop them blocking each other (thanks to Nick) so I think they can now both co-exist if required.

---

<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:** [10 April 2020 21:18 UTC](https://discourse.nodered.org/t/how-to-manage-the-image-output-image-tools-node-conflict-split-topic/24122/10 "2020-04-10T21:18:09Z")

</div>

> [@dceejay](#):
>
> I think we have managed to stop them blocking each other (thanks to Nick) so I think they can now both co-exist if required

I had considered that (and it aligns with my original musings when debating whether to include/exclude the image viewer inside `image-tools`)

Definitely food for thought.

> [@dceejay](#):
>
> Re full data url and missing mime type - I guess I 'm not quite up to speed on the subtlety of that - but I'm sure you guys can enlighten me or Bart can fix it 😉

Haha - yeah, crack on Bart 😉

> [@dceejay](#):
>
> wire and button ... uuuurgh - please god no... I would get it banned if you do that... (OK maybe not - but there will be words!!!) . You could have an option instead... if configured in passthrough mode then remove the button and add the pin... and vice versa.

I agree its fugly - BUT - there are valid reasons for having INPUT + BUTTON or OUTPUT + BUTTON  
Perhaps an alternative button placement would be a good in these cases?  
something like a toggle button (depressed/non depressed style) where the image is shown?

> [@dceejay](#):
>
> when installed - jimp-compact is 482k... vs jimp is 24MB... I think I know which I prefer for something I don't use every day. Smaller every time. Re getting behind... what are you thinking may be needed ?

Some of the plugins like `threshold` for example. Not sure if `jimp-compact` supports the plugins. My main concern though is this compact version becomes neglected.  
I should probably explore this option

---

<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:** [10 April 2020 21:27 UTC](https://discourse.nodered.org/t/how-to-manage-the-image-output-image-tools-node-conflict-split-topic/24122/11 "2020-04-10T21:27:58Z")

</div>

> [@Steve-Mcl](#):
>
> I agree its fugly - BUT

Yes it's worse than fugly and there are no buts....

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [10 April 2020 21:51 UTC](https://discourse.nodered.org/t/how-to-manage-the-image-output-image-tools-node-conflict-split-topic/24122/12 "2020-04-10T21:51:23Z")

</div>

> [@dceejay](#):
>
> I think they can now both co-exist if required.

Yes that is indeed another option. Because I see that already other [nodes](https://flows.nodered.org/node/node-red-contrib-image-simple-node) are being developed to show images in the flow editor ...

But still would be nice to have a single node with all features. Seems a bit user unfriendly that I need to use one node for feature X, and another node for feature Y. That feels so non-professional ...

The only thing that bothers me: I would like to have a node which has an output (for chaining without cloning) **AND** (not OR) a disable button. Then you can use such a node inside a chain **AND** you can disable it at runtime. But it isn't possible to have both features at the same time 🥴

> [@dceejay](#):
>
> Bart can fix it

Ok, let's have a quick look in my calendar.  
Seems I have again free time available to do this, starting from 12 april:

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

---

<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:** [10 April 2020 22:04 UTC](https://discourse.nodered.org/t/how-to-manage-the-image-output-image-tools-node-conflict-split-topic/24122/13 "2020-04-10T22:04:53Z")

</div>

Agreed a single node would be nice - this is supposed to be a simple image debug/display node - leaving Steve's other nodes for the manipulations so I really don't want 24MB of cruft just for that.

Also don't forget these nodes are all using an undocumented / unsupported API that may well change as we move forward so I wouldn't want them to get too invested with functionality.

Great - looking forward to the 13th ! Happy Easter !

---

<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:** [14 April 2020 08:54 UTC](https://discourse.nodered.org/t/how-to-manage-the-image-output-image-tools-node-conflict-split-topic/24122/14 "2020-04-14T08:54:36Z")

</div>

Hi Steve

any chance I can get a copy of the test flow you used in [How to manage the image-output / image-tools node conflict (split topic)](https://discourse.nodered.org/t/how-to-manage-the-image-output-image-tools-node-conflict-split-topic/24122/6)  
so I can see those bugs first hand ?

---

<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:** [14 April 2020 10:16 UTC](https://discourse.nodered.org/t/how-to-manage-the-image-output-image-tools-node-conflict-split-topic/24122/15 "2020-04-14T10:16:47Z")

</div>

Sure - no bother. (attached as too large for inline code)

[flows.json](https://discourse.nodered.org/uploads/short-url/kitF9aRts2lU3npj3KwtlJ8XGCF.json) (38.7 KB)

---

<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:** [14 April 2020 10:27 UTC](https://discourse.nodered.org/t/how-to-manage-the-image-output-image-tools-node-conflict-split-topic/24122/16 "2020-04-14T10:27:01Z")

</div>

Dave, feel free to peruse the repo of [node-red-contrib-image-tools](https://github.com/Steve-Mcl/node-red-contrib-image-tools)

In particular [here](https://github.com/Steve-Mcl/node-red-contrib-image-tools/blob/e42b1f5a6454da1c60df2e3d1547b5fb6d744484/imageViewer.js#L84) and [here](https://github.com/Steve-Mcl/node-red-contrib-image-tools/blob/e42b1f5a6454da1c60df2e3d1547b5fb6d744484/imageViewer.js#L41)

---

<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:** [13 June 2020 10:27 UTC](https://discourse.nodered.org/t/how-to-manage-the-image-output-image-tools-node-conflict-split-topic/24122/17 "2020-06-13T10:27:01Z")

</div>

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