1. NodeBox 1
    1. Homepage
    2. NodeBox 3Node-based app for generative design and data visualization
    3. NodeBox OpenGLHardware-accelerated cross-platform graphics library
    4. NodeBox 1Generate 2D visuals using Python code (Mac OS X only)
  2. Gallery
  3. Documentation
  4. Forum
  5. Blog

AttributeError when using p.max() to get color

Posted by Acido Cínico on Dec 31, 2008

Hi, I know this is beginner issue, but it's driving me crazy:
I want to extract a color from a layer and use it for blending afterwards:

img = choice(files("/.../*.jpg)
l = canvas.append(img)
#...
l.filter("edges", intensity=random(20))
p = l.pixels()
clr = p.max()
l = canvas.append(color(clr))
l.blend(50, mode = "multiply")
But I get the error:
" AttributeError: CoreImagePixels instance has no attribute 'a'
".
I guess it has to do with specifying the opacity...
Many thanks in advance.


 
Posted by Tom De Smedt on Jan 04, 2009

It's a bug in the Core Image library. I've fixed it in the latest version, you can download it and your problem should go away.



Posted by Acido Cínico on Jan 28, 2009

Thanks!!!