loadImage(path);Load a png or jpeg image
Arguments
pathThe local image pathReturns
ImageThe image instancefunction setup()
createWindow(600, 600);
img = loadImage('/path/to/mypic.png');
end
function draw()
background(51);
image(img, 0, 0);
end image(img, x, y, [w], [h]);Draw an image to the screen
Arguments
imgThe Image instancexThe x position of the imageyThe 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 heightImage.crop(x, y, w, h);Crop an Image into an other Image
Arguments
xThe x position of the imageyThe y position of the imagewThe width of the new cropped imagehThe height of the new cropped imageReturns
Imagethe cropped image