# NodeBox

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

# photobot.Canvas.preferences()

## Syntax

canvas.preferences(interpolation=BILINEAR)

## Description

Sets a number of preferences that influences how layers are processed on this canvas. Currently, only defines the image interpolation, which can be set to NEAREST, BICUBIC or BILINEAR. Image interpolation controls how pixels are manipulated when rotating and scaling layers for example: with NEAREST being a fast but lossy interpolation, and BILINEAR being a more accurate yet slower interpolation. Image interpolation is set to BILINEAR (best) by default.

## Syntax

    photobot = ximport("photobot")
    canvas = photobot.canvas(200,200)
    canvas.preferences(interpolation=NEAREST)
    canvas.layer("robot.jpg")
    canvas.layers[1].rotate(30)