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

Core Image and downloading images from the web

Posted by brendan Dawes on Oct 19, 2007

Is it possible to have core image create a layer using a url from the web. I know this is possible with the morguefile library but can it work with the web library for instance - cant get it to work at the moment.


 
Posted by Tom De Smedt on Oct 19, 2007

Hi Brendan,

Please download the latest version of the Core Image library. I've added a canvas.layer_bytes() command that creates a layer from an image data string (instead of a filename).

So you can do:

web = ximport("web")
image_data = web.download("http://nodebox.net/code/g/header.jpg")
 
coreimage = ximport("coreimage")
canvas = coreimage.canvas(150, 150)
canvas.layer_bytes(image_data, x=-190)
canvas.draw()
Best regards,
Tom



Posted by brendan Dawes on Oct 19, 2007

awesome!