I am working on an image node. Who's in?
Fellow NodeBoxers,
For several months now I've been working on a general purpose image node and am getting close.
I plan on sharing it, but would like to know who would want to use it. If you would like to incorporate images (PNG, JPG, BMP, TIFF) into your NodeBox projects, please hit the reply button, say "ME!", and maybe also say what you might want to use it for. The more responses I get, the more motivated I will be to get this thing out the door ASAP.
Some Background
A way of incorporating images is probably the single most requested NodeBox feature. NodeBox is and will remain a pure vector application - not much I can do about that. But by using some Python code and a NodeBox subnetwork, I can read in a file and output a "pixel group" - a group of square rectangles each with a position, a pixel size, and a fill color. The output will appear in your drawing area as an actual image and you can feed it into all the usual nodes like any other group of paths.
The challenge is that even a small or low-res image has a LOT of pixels. My experience has been that Nodebox can only handle pixel groups of about 100,000 rects. Much higher and it becomes painfully sluggish and starts getting memory errors. To protect you from crashing Nodebox I limit output to 100,000 pixels.
100,000 pixels is a lot or rectangles, but only .1 megapixels, enough to display a 400 x 250 pixel photo - about the size of a post-it note on a typical laptop screen. Fortunately, it is possible to get surprisingly good results by either down-sampling (capturing, say, every third pixel), or by using a mask to capture a portion of the image. This is what my node does.
For the mask you can feed in any closed shape (a rect, a circle, a star, a text path) OR a series of points resampled along one or more paths (concentric circles, lines, a spiral). Once you've captured a pixel group you can adjust it in many ways, including turning the squares into dots of different sizes based on the luma value, applying color filters, etc.
These are things I am starting to play with. You could also use images as a reference for placing vector elements, use the pixels as a source of perlin-like noise, take pixel slices through individual frames of a movie and arrange them into color strips - the possibilities are endless!
So if this sounds interesting, please hit the Reply button and type "I'm in!" Questions and suggestions always welcome.
John
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
1 Posted by Alexander Gogl on 13 Jan, 2021 07:44 AM
Dear John,
I am interested in testing your image node. Please keep me updated.
Best,
Alexander
john <[email blocked]> --- 2021-01-12 Tue 18:11:
2 Posted by Guilherme Vieir... on 13 Jan, 2021 01:54 PM
Hi John,
It would be a very interesting node, I imagine many possibilities with images as a data source.
It might help in this endeavor to try to look at how the images were implemented in DrawBot (https://www.drawbot.com/content/images.html). The NodeBox shares similar output limitations, at least in older versions of DrawBot.
Support Staff 3 Posted by john on 13 Jan, 2021 04:45 PM
Alexander, Guilherme,
Thanks for responding! I will email you both the current version of my image node soon and would appreciate it if you could test it out on various images before I release it to the wider community.
DRAWBOT
Thanks also for the link to DrawBot, Guilherme. I took a quick look at it. I have something very similar to their image, imageSize, and imagePixelColor.
But my node and python code is much more limited and humble. I do as little as possible in Python; I just get colors and use a subnetwork to present them as a group of rects that you can then play with in NodeBox. My Python code is very short but, I think, has no dependencies. It should work without you having to install any image libraries or do anything like that.
DrawBot's list of filters is most impressive. I intend to provide a separate node to do some very limited manipulations of the "pixel" rects just to get people started (e.g. convert square pixels to multi-size dots). But in theory you could construct all sorts of fancy filter nodes right in NodeBox (with images of no more than .1 megapixels). For example, you should be able to convert a small pixel group into ASCII art.
This would not be for serious image manipulation (which you can already do in zillions of other apps and then import into NodeBox using my node). It would just be for fun and experimentation - and generative art. Perhaps we could construct and share some filter nodes here on the forum.
If you are really into both DrawBot and NodeBox, it should be possible to combine them by creating custom NodeBox nodes from DrawBot Python source code on their Github site. You would have to install DrawBot and import their library inside your custom NodeBox Python code. (As I said, I didn't want to require any such dependencies.). If that idea interests you, you could study my very simple Python code to see how to pass things like colors and rects back to NodeBox.
I am going to fix a few more bugs and try a few more things. But I'll send you both something to play with soon.
John
4 Posted by seohyo on 16 Jan, 2021 10:26 AM
Dear John,
I'm really interested in your image node!
It's exactly what I am looking for.
You always make something beyond imagination.
Hope to see your new works with new nodes soon:)
Seo
Support Staff 5 Posted by john on 17 Jan, 2021 04:53 AM
Alexander, Guilherme,
I just emailed you the beta Image node with some samples and documentation. Please reply ASAP with your first impressions. I hope to release the node to everyone else soon.
John
Support Staff 6 Posted by john on 19 Jan, 2021 05:44 AM
UPDATE
I heard from Guilherme that the image node is not working under Windows 10. I think I found the problem but am currently stumped about how to fix it. If there are any Windows experts out there who would like to help, please reply to this thread.
Still waiting to hear from Alexander.
Support Staff 7 Posted by john on 19 Jan, 2021 10:01 AM
UPDATE to my UPDATE
I think I found the REAL problem. Image Node should now work under Windows 10 as well as under MacOS. I have sent the updated version of my beta to Guilherme and Alexander and await their confirmation.
Progress!
John
Support Staff 8 Posted by john on 21 Jan, 2021 08:09 PM
I have just published v1 of the image node in the Show Your Work area:
http://support.nodebox.net/discussions/show-your-work/400-image-node
Have at it!
John