Hey Gustaf,

Check out nuke.Node.sample. You could do something like the below, though
will be quite slow. Depending what you're trying to do (i.e. something
simple) it might be practical, then should be easy after you have sampled
rgb to use numpy to do whatever you want.


Though if you are doing some heavy lifting it might be worth learning the
c++ sdk?


You're not reading the O'Reilly Python Computer Vision book by chance, are
ya?


cb = nuke.nodes.ColorBars(format='square_512')    # start small and pray

for scanline in xrange(cb.format().height()):

    for px in xrange(cb.format().width()):

        red = cb.sample(channel='rgba.red', x=px, y=scanline)

        green = cb.sample(channel='rgba.green', x=px, y=scanline)

        blue = cb.sample(channel='rgba.blue', x=px, y=scanline)

        print('{0},{1} has r,g,b: {2},{3},{4}'.format(px, scanline, red,
green, blue))

-Ean


On Tue, Jun 4, 2013 at 3:44 PM, Kel Solaar <
nuke-python-re...@thefoundry.co.uk> wrote:

> **
> I would also been keen on knowing!
>
> Cheers,
>
> KS
>
> _______________________________________________
> Nuke-python mailing list
> Nuke-python@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
>
>
_______________________________________________
Nuke-python mailing list
Nuke-python@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python

Reply via email to