# NodeBox

Create visual output with Python programming code
Home Download Reference Tutorial Library Gallery About

# Reference | image()

Syntax |
    image(path, x, y, width=None, height=None, alpha=1.0, data=None)
Description | Draws an image to the screen. An image is a JPEG-, GIF-, PNG-, AI-, EPS-, TIF-, PSD-, or PDF-file stored on disk. For vector works, EPS is the best format to use. The first parameter sets the pathname of the image file. By default, NodeBox looks for files in the Home folder, or the folder where the NodeBox file is saved. The following two parameters set the location of the image. The fourth and fifth parameters are optional and define the width and height of the image. When set, the image is scaled to the given width and height. The sixth parameter is optional as well, and sets the alpha (opacity) value for the image. This value ranges between 0.0 and 1.0. The last optional parameter is used when supplying an image as a data stream instead of a file path.
Example |
    image("images/engine.png", 50, 0)