read?? books??? sorry!

the numpy lib is pretty fast on large sets of data, and with it you could
open up some possibilities for procedurally generating images or even as a
poor mans cortex(?)

I know about the sample, but it only gets me half way, right? Would also
like to write the pixel values back into the nodes buffer.



On Thu, Jun 6, 2013 at 9:56 AM, Ean Carr <[email protected]> wrote:

> 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 <
> [email protected]> wrote:
>
>> **
>> I would also been keen on knowing!
>>
>> Cheers,
>>
>> KS
>>
>> _______________________________________________
>> Nuke-python mailing list
>> [email protected], http://forums.thefoundry.co.uk/
>> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
>>
>>
>
> _______________________________________________
> Nuke-python mailing list
> [email protected], http://forums.thefoundry.co.uk/
> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
>
>


-- 
■ ■ ■ ■ ■ ■ ■ ■ ■ ■
_______________________________________________
Nuke-python mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python

Reply via email to