# \[Announce\] node-red-contrib-image-tools - updated v1.3.1

**URL:** <https://discourse.nodered.org/t/announce-node-red-contrib-image-tools-updated-v1-3-1/10751>\
**Category:** Share Your Nodes\
**Created:** [2 May 2019 18:39 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-image-tools-updated-v1-3-1/10751 "2019-05-02T18:39:43Z")\
**Posts on this page:** 20\
**Page:** 2

<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 May 2019 18:09 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-image-tools-updated-v1-3-1/10751/21 "2019-05-09T18:09:53Z")

</div>

Glad to hear it.

Some things that may not seem obvious but...

- You can get images from the internet (just put a URL in the image field)
- By the same token, you can get an image from a webcam

---

<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 May 2019 18:19 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-image-tools-updated-v1-3-1/10751/22 "2019-05-09T18:19:29Z")

</div>

Ps, you could/should raise an issue on GitHub [Here](https://github.com/rikukissa/node-red-contrib-image-output) explaining the issue. Hopefully it will get fixed. (I think it doesn't work in IE also)

---

<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:** [9 May 2019 18:49 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-image-tools-updated-v1-3-1/10751/23 "2019-05-09T18:49:54Z")

</div>

Hey @Steve-Mcl,

These are the kind of nodes that I just love!  
Thanks for implementing and sharing them with us!!!!!!

> [@Steve-Mcl](#):
>
> Ps, you could/should raise an issue on GitHub [Here](https://github.com/rikukissa/node-red-contrib-image-output)

You should have a look at the contributor list of that node. Think you know the second guy already ...

I have a small issue with your node (which I downloaded from NPM):

1. I import your example (image processing incl. image-output node)
2. Then I double click on the first Invert node in the flow
3. But the _ **dropdown is empty** _, i.e. I cannot select any options in it.
4. So I had a look at the browser console, and saw this one:  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/3/3aae010e3264b77d1dd82e2ac270d25da7190a0c.png)
5. When I debug the code, it seems to be going wrong at this line:  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/e/e0e4a32677922c26cef4639f4e785fbf93898250.png)
6. When I reopen the same config screen again, the dropdown is filled correctly ...

Would be nice if you could have a look at it please. Think you just need to change '_property_' into '_key_'?

Some other small remarks:

1. If you ever find some time to add the examples and some explanation on your readme page, that would really be nice.
2. Perhaps add some extra keywords (image, manipulation, ...) to your package.json file, to make sure users can find it easier.
3. You have added a performanceLogger.js Is that something we can trigger somehow, or did you get any useful information from this yourself?
4. You allow a '_jimp object_' to be passed via the Node-RED wires. I didn't have a look at those Jimp objects yet, but I'm wondering if you had any issues passing these object in Node-RED? E.g. when your output is connected to two wires, the Jimp object will be **cloned** by Node-RED. We (@btsimonh) failed to do something similar with OpenCV image objects some time ago, but that was mostly caused by the fact that those C++ objects where allocated outside the NodeJs memory. So very nice to see that it works fine with pure Javascript image objects.

Good work !!!!!!  
Bart

---

<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:** [9 May 2019 19:39 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-image-tools-updated-v1-3-1/10751/24 "2019-05-09T19:39:42Z")

</div>

the issue with FF (and probably Edge) is that the svg getBbox() command returns 0 for the image size and offset. If anyone can help fix that then thanks in advance.

---

<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 May 2019 20:05 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-image-tools-updated-v1-3-1/10751/25 "2019-05-09T20:05:21Z")

</div>

> [@BartButenaers](#):
>
> I have a small issue with your node (which I downloaded from NPM):
> 
> 1. I import your example (image processing incl. image-output node)
> 2. Then I double click on the first Invert node in the flow
> 3. But the _ **dropdown is empty** _ , i.e. I cannot select any options in it.

Would you believe it if I said it took longer to get the dynamic typedinput property widgets working than the rest of the whole project. P. I. T. A. Grrr

That particular line of code was last minute trying to get the node working in IE (another PITA)

I'll check it out as soon as I can.

As for keywords, now you have had a chance to explore the node and it's capabilities, could you suggest a list please?

---

<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:** [9 May 2019 20:52 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-image-tools-updated-v1-3-1/10751/26 "2019-05-09T20:52:09Z")

</div>

Aha - maybe got the image sizes... version 0.4.1 of image viewer now works on FF.

---

<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 May 2019 21:18 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-image-tools-updated-v1-3-1/10751/27 "2019-05-09T21:18:36Z")

</div>

> [@BartButenaers](#):
>
> You have added a performanceLogger.js Is that something we can trigger somehow, or did you get any useful information from this yourself?

I created that class as image processing is something that particularly taxes the CPU and JS. So I added it to allow users to understand where there cycles are going. Its not exposed per-se but I have been considering separating it out as a node for measuring other nodes performance.

> [@BartButenaers](#):
>
> You allow a ' _jimp object_ ' to be passed via the Node-RED wires. I didn't have a look at those Jimp objects yet, but I'm wondering if you had any issues passing these object in Node-RED? E.g. when your output is connected to two wires, the Jimp object will be **cloned** by Node-RED.

Not seeing any issues but to be truthful, I didn't consider it as it didn't crop up as an issue during development. Typically though, I expect users will be doing serial or batch processing to minimize CPU hit.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/c/c457d396d9a833c4e2cd06404ed8fc4cc729dc2f.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:** [9 May 2019 21:47 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-image-tools-updated-v1-3-1/10751/28 "2019-05-09T21:47:34Z")

</div>

> [@Steve-Mcl](#):
>
> Would you believe it if I said it took longer to get the dynamic typedinput property widgets working than the rest of the whole project.

Yes I believe you 😉

> [@Steve-Mcl](#):
>
> As for keywords, now you have had a chance to explore the node and it's capabilities, could you suggest a list please?

Since your list of available actions is quite long, I was thinking more about the same keywords you also find at the top of the Jimp page:

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

So "_image_", "_processing_", "_manipulation_", "_picture_" ... perhaps ?

P.S. Thanks for the other information !!!

> [@dceejay](#):
>
> Aha - maybe got the image sizes... version 0.4.1 of image viewer now works on FF.

I'm impressed you solved it that quickly! Was also looking simultaneously, but didn't find anything useful that fast ... I can confirm it works now fine on both _Chrome_ and _Firefox_ ! But unfortunately no images are displayed on my _Edge_ browser ...

---

<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:** [9 May 2019 21:53 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-image-tools-updated-v1-3-1/10751/29 "2019-05-09T21:53:52Z")

</div>

Yet another Edge case. Will let the windows folk worry about it

---

<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 May 2019 22:15 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-image-tools-updated-v1-3-1/10751/30 "2019-05-09T22:15:03Z")

</div>

Last update for a while (hopefully)

V0.1.2

- fixed issue pointed out by @BartButenaers
- updated readme
- added more keywords to package.json
- added `quality` function
- added new example showing use of `quality` function and getting an image from the internet ...
  - ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/c/c9e03d68c2dd463d01ee9dfee65b635efbaa7b06.png)

> **[node-red-contrib-image-tools](https://www.npmjs.com/package/node-red-contrib-image-tools)**
>
> A node-red node to manipulate images with the jimp library and decode barcodes with zxing

---

<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:** [9 May 2019 23:06 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-image-tools-updated-v1-3-1/10751/31 "2019-05-09T23:06:30Z")

</div>

likewise image viewer 0.4.2 may now work with edge

---

<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 May 2019 23:13 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-image-tools-updated-v1-3-1/10751/32 "2019-05-09T23:13:20Z")

</div>

IE11? I seen to remember it didn't work with that when I tried 🙂

Edit...  
Same for my node (problem for another day)

---

<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:** [9 May 2019 23:21 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-image-tools-updated-v1-3-1/10751/33 "2019-05-09T23:21:06Z")

</div>

I'll leave that as an exercise for someone else.

---

<div class="post-metadata">

**Author:** ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)\
**Post date:** [10 May 2019 06:09 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-image-tools-updated-v1-3-1/10751/34 "2019-05-10T06:09:10Z")

</div>

Just tried 'image-tools' with 'image-viewer' and can confirm the previews now appear in:  
Firefox 68.0a1 (2019-05-09) (64-bit)  
Waterfox 56.2.9 (64-bit)  
as well as Chrome

Thanks guys for the updates.

---

<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 May 2019 06:15 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-image-tools-updated-v1-3-1/10751/35 "2019-05-10T06:15:06Z")

</div>

> [@dceejay](#):
>
> likewise image viewer 0.4.2 may now work with edge

Hey Dave,  
Quick test before I'm off to work...  
Your night work resulted in a major improvement, but there is still something wrong (on Microsoft Edge 42.17134.1.0):

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

I assume the images are displayed correctly on top of the colored bubble background, in your Edge version?

> [@Steve-Mcl](#):
>
> IE11? I seen to remember it didn't work with that when I tried

Steve,  
If I where you, I wouldn't mention **IE11** anymore to Dave, otherwise you will also not have much time to sleep next weekend:

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/2/2f3472f5c8e1bd76e5f3993c38102e71cceea425.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:** [10 May 2019 06:18 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-image-tools-updated-v1-3-1/10751/36 "2019-05-10T06:18:54Z")

</div>

> [@BartButenaers](#):
>
> ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/2/2f3472f5c8e1bd76e5f3993c38102e71cceea425.png)

That's the problem I was getting in IE. I have no idea how to fix this one.

There is nothing in log.

Anyone?

@knolleary, @dceejay, my apologies for tagging you guys directly but I'm certain in the development of nodes you will have seen this problem? As far as i can tell, its happening inside `RED.nodes.registerType` & its something IE doesn't support but there is nothing logged in console. Short of going through MDN and checking every line, i'm struggling with this & would appreciate it if you had any ideas?

---

<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 May 2019 09:37 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-image-tools-updated-v1-3-1/10751/37 "2019-05-10T09:37:52Z")

</div>

Ok, I believe I have sorted this `SyntaxError: Syntax Error` problem in IE (and fixed a few bugs - update imminent)

I wish that node-red could have console logged the line in question?

Hey ho.

For anyone else facing this issue - IE11 doesn't like fat arrows (I already knew this but still used them!)

@dceejay would you be able to replace the fat arrows in `node-red-contrib-image-output` [here](https://github.com/rikukissa/node-red-contrib-image-output/blob/master/image/image.html#L11) and [here](https://github.com/rikukissa/node-red-contrib-image-output/blob/master/image/image.html#L108) with standard function callbacks please?

While on this, I was considering incorporating the code of `node-red-contrib-image-output` directly into my node. Makes sense as both nodes use Jimp. Thoughts?

---

<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 May 2019 09:41 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-image-tools-updated-v1-3-1/10751/38 "2019-05-10T09:41:42Z")

</div>

busy today - but will happily take a PR

---

<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 May 2019 10:02 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-image-tools-updated-v1-3-1/10751/39 "2019-05-10T10:02:36Z")

</div>

I'll try thanks.

PS, I think template strings are also a problem in IE11  
probalby need to replace ``image-output-img${id}`` with `'image-output-img' + id`

---

<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 May 2019 16:58 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-image-tools-updated-v1-3-1/10751/40 "2019-05-10T16:58:44Z")

</div>

## Firstly...

@dceejay

Hi I hope i don't offend anyone here but I decided for the reasons below to actually build-in to my image-tools nodes its own image viewer node.

- node-red-contrib-image-output (Image preview) didn't use Jimp so, to use the this original node with "image tools", the user needed to either convert his image to a buffer or strip the mime type off the base64 output (as the mime type is re-added as a hard coded png type inside image preview src)
  - That meant adding jimp as a dependency to node-red-contrib-image-output
  - Also, as base64 png type was hard coded in src, without the Jimp lib it would be difficult to determine mime type of a buffer or base64 (data without mime type)
  - Lastly, at some point i wish to include image info (size, type etc) in the output of the preview node

- Additionally I wished to have an output on the viewer node for chaining operations
- I also hoped to improve user experience by having a viewer available without extra installation

For these reasons, I decided to leave "image preview" as its own light(er) weight entity.

_Please feel free to tell me if there was a better way I could have/should have achieved this (I am unfamiliar with forking or if its possible to inherit existing node-red node into this one as a dependency somehow?)_

**Full credit** to [rikukissa](https://github.com/rikukissa) and [dceejay](https://github.com/dceejay) for the excellent [node-red-contrib-image-output](https://github.com/rikukissa/node-red-contrib-image-output) on which my "image viewer" node is heavily based. (Copy of this credit & MIT license included in src files as requested)

PS: I'll try over the weekend to make a PR for "image preview". If you beat me to it, you need to replace the fat arrows with regular functions & modify the ``template ${strings}`` to `'regular' + strings` to make it work in IE.

## Update...

V0.2.3 now in NPM.

## Highlights...

- New node added "image viewer" (detailed above).
  - This is heavily based on the [image preview](https://github.com/rikukissa/node-red-contrib-image-output) node
  - works for Jimp image, Buffer, Base64 (bmp, png, jpg), URL and file path

- All nodes work in IE
- Bug fixes (more than i care to admit)

## Example...

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/5/595b99e3c7a9ab7a9384fc7436cf7deca434b6bf.png)

## Known issues...

Clicking the image viewer in IE does not close the preview (works in chrome)

[Previous page](https://discourse.nodered.org/t/announce-node-red-contrib-image-tools-updated-v1-3-1/10751.md?page=1)

[Next page](https://discourse.nodered.org/t/announce-node-red-contrib-image-tools-updated-v1-3-1/10751.md?page=3)
