image

v0.1.6
loadImage(path);

Load a png or jpeg image

Arguments

pathThe local image path

Returns

ImageThe image instance

function setup()
  createWindow(600, 600);
  img = loadImage('/path/to/mypic.png');
end

function draw()
  background(51);

  image(img, 0, 0);
end   
See loadImage in image.h
image(img, x, y, [w], [h]);

Draw an image to the screen

Arguments

imgThe Image instance
xThe x position of the image
yThe y position of the image
[w]The width of the image, if not specified, using source width
[h]The height of the image, if not specified, using source height

See image in image.h
Image.crop(x, y, w, h);

Crop an Image into an other Image

Arguments

xThe x position of the image
yThe y position of the image
wThe width of the new cropped image
hThe height of the new cropped image

Returns

Imagethe cropped image

See Image.crop in image.h