tag:support.nodebox.net,2012-11-01:/discussions/general-discussion/12836-bitmap-importNodeBox: Discussion 2018-10-19T08:14:53Ztag:support.nodebox.net,2012-11-01:Comment/313083072014-01-26T14:03:04Z2014-01-26T14:03:05Zbitmap import<div><p>Hi!<br>
would it be possible to make an " bitmap analyzing" node via
Python?<br>
(that would for example retrieves brightness of pixels at certain
coordinates) Thanks !</p></div>olivetag:support.nodebox.net,2012-11-01:Comment/313083072014-01-29T08:39:45Z2014-01-29T09:24:41Zbitmap import<div><p>hi,</p>
<p>Doing things like this is possible, you just need to import some
python code through</p>
<blockquote>
<blockquote>
<p>file >> code libraries.</p>
</blockquote>
</blockquote>
<p>I've included a simple example that retrieves the red component
and the location for a pixel and returns the value so it can be
used in NB. Change the python code to retrieve other values..</p>
<p>You also will have to make a new node which refers to the python
file and function.</p>
<p>regards,<br>
lieven</p></div>lievenmenschaerttag:support.nodebox.net,2012-11-01:Comment/313083072014-01-29T21:38:34Z2014-01-29T21:38:34Zbitmap import<div><p>Great!!<br>
thanks for that . I'll try it soon.<br>
Cheers</p></div>olivetag:support.nodebox.net,2012-11-01:Comment/313083072014-01-30T20:53:58Z2014-02-04T08:52:02Zbitmap import<div><p>Thanks again for this answer, it was more than what I was
dreaming of and exactly what i needed!<br>
Now, I'm totally beginner at Python but I'm amazed that you could
just import Java image libraries to do the job for Python. Is that
a magic from Nodebox or is it always like that?<br>
Cheers,<br>
Olivier</p></div>olivetag:support.nodebox.net,2012-11-01:Comment/313083072014-02-05T09:23:20Z2014-02-05T09:23:20Zbitmap import<div><p>NodeBox is written in Java and uses <a href=
"http://jython.org/">Jython</a>, a Python implementation in Java.
Jython can access anything that the JVM has access to, including
image libraries.</p></div>Frederik De Blesertag:support.nodebox.net,2012-11-01:Comment/313083072014-02-05T16:50:29Z2014-02-05T16:50:29Zbitmap import<div><p>That's great!<br>
Thanks for that explanation.<br>
Cheers<br>
/olivier</p></div>Olivier