# NodeBox

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

# photobot.Layer.desaturate()

## Syntax

    canvas.layers[i].desaturate()

## Description

Desaturates layer i, making it grayscale. Instantly removes all color information from the layer, while maintaing its alpha channel.

## Example

    photobot = ximport("photobot")
    canvas = photobot.canvas(100,100)
    canvas.layer("robot.jpg")
    canvas.layers[1].desaturate()