if (do_name() != 'Home') : ?>
endif ?>
Posted by Tom De Smedt on May 29, 2007
Hi Nunia,
Here is a script that exports images from NodeBox:
from AppKit import * def export(name, extension=".jpg", compression=0.7): try: # Exporting only works from the second run. img = _ctx._ns["graphicsView"].image except: return img = img.TIFFRepresentation() img = NSBitmapImageRep.imageRepWithData_(img) options = None if extension == ".gif": type = SGIFFileType if extension == ".png": type = NSPNGFileType if extension == ".jpg": type = NSJPEGFileType options = {NSImageCompressionFactor: compression} data = img.representationUsingType_properties_(type, options) f = open(name+extension, "w") f.write(data.bytes()) f.close() # Now draw some things on the canvas. size(400,400) background(None) for i in range(100): fill(random()) oval(random(WIDTH), random(HEIGHT), 100, 100) # Export it to file, you can choose .jpg, .gif and .png! # The file will be in the same folder as the script. # Remember, export only works from the second time # you run the code. export("test", extension=".png")Enjoy!
Posted by nunia on May 29, 2007
thanks! this can be _very_ handy.
I also installed iSquint which shrinks 96M .mov to 500k .mp4. Sweet!
Posted by Frido on Sep 18, 2007
include("util/comment.php"); ?>
Lifesaver! Thx
exporting to .gif ?
Posted by nunia on May 29, 2007this is my wish list. Can nodebox add exporting to .gif as another format? QuickTime movie files are a bit _fat_ ...