a port of the Processing Visualization Language
Name

createImage()

Examples
example pic
PImage img = createImage(66, 66, RGB);

for(int i=0; i < img.pixels.length; i++) {

  img.pixels[i] = color(0, 90, 102); 

}

image(img, 17, 17);
example pic
PImage img = createImage(66, 66, RGB);

for(int i=0; i < img.pixels.length; i++) {

  img.pixels[i] = color(0, 90, 102, i%img.width * 2); 

}

image(img, 17, 17);

image(img, 34, 34);
Description Creates a new PImage (the datatype for storing images). This provides a fresh buffer of pixels to play with. Set the size of the buffer with the width and height parameters. The format parameter defines how the pixels are stored. See the PImage reference for more information.

Be sure to include all three parameters, specifying only the width and height (but no format) will produce a strange error.
Syntax
createImage(width, height, format)
Parameters
width int: width in pixels
height int: height in pixels
format Either RGB, ARGB, ALPHA (grayscale alpha channel)
Usage Web & Application
Related PImage
PGraphics

This reference is licensed under the CC BY-NC-SA 2.0 license:

Creative Commons License
Fork me on GitHub