Education/Projects/ProcessingForTheWeb/PImage

From MozillaWiki
Jump to: navigation, search

Summary

This is a class written for Education/Projects/ProcessingForTheWeb. It is a data type for storing images. Images can be displayed in 2D and 3D. Before any image can be used it must be loaded using the loadImage() function. View official Reference

Examples

PImage = loadImage("laDefense.jpg");
image(b, 0, 0);

Fields

width: the width of the image
height: the height of the image
ImageData a canvas element that contains width, height, and a pixel array.

The pixel array size is width * height * 4.

Methods

Description
get() Reads the color of any pixel or grabs a rectangle of pixels
set() Writes a color to any pixel or writes an image into another
copy() Copies the entire image
mask() Masks part of the image from displaying
blend() Copies a pixel or rectangle of pixels using different blending modes
filter() Converts the image to grayscale or black and white
save() Saves the image to a TIFF, TARGA, PNG, or JPEG file
resize() Changes the size of an image to a new width and height
loadPixels() Loads the pixel data for the image into its pixels[] array
updatePixels() Updates the image with the data in its pixels[] array

Bugs

Refer to the reference of each function for a specific bug report.

Bug Description Fixed?(Date)

Tests

Test Location
constructor [1]