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

path2pixel

Posted by jelle on Jan 11, 2008

Hi,

When thinking about the new CoreImage stuff ( great! ), it crossed my mind that it would be really cool if path primitives could be rendered to a pixel image. That way it would be easier to generate tracing that still show parts of previous stages of the drawing. I'm sure those of you familiar with Processing are aware of this powerful technique.
Might be interesting, don't you think?
A call like path.toPixelImage( pixelImg, alpha ) would be a very welcome addition.

-jelle


 
Posted by anonymous on Jan 11, 2008

You can, with CoreImage.

coreimage = ximport('coreimage')
path = oval(0, 0, 100, 100) # or whatever you want
cnvs = coreimage.canvas(100, 100)
layer = cnvs.layer_path(path)
# now, you can work with the pixels directly,
pixels = layer.pixels()
# or export to an image.
cnvs.export("filename")
Hope this helps!