image

image-mode

load-image

mask-imageclj

no-tint

request-image

tint

tint-float

tint-int

image

Arguments
[img x y][img x y c d]
Docstring
Displays images to the screen. Processing currently works with GIF,
JPEG, and Targa images. The color of an image may be modified with
the tint function and if a GIF has transparency, it will maintain
its transparency. The img parameter specifies the image to display
and the x and y parameters define the location of the image from its
upper-left corner. The image is displayed at its original size
unless the width and height parameters specify a different size. The
image-mode fn changes the way the parameters work. A call to
(image-mode :corners) will change the width and height parameters to
define the x and y values of the opposite corner of the image.

Starting with release 0124, when using the default (JAVA2D)
renderer, smooth will also improve image quality of resized
images.
Works only inside sketch functions?
Yes
Original Processing method
image()

image-mode

Arguments
[mode]
Docstring
Modifies the location from which images draw. The default mode is :corner.
 Available modes are:

:corner  - specifies the location to be the upper left corner and
           uses the fourth and fifth parameters of image to set the
           image's width and height.

:corners - uses the second and third parameters of image to set the
           location of one corner of the image and uses the fourth
           and fifth parameters to set the opposite corner.

:center  - draw images centered at the given x and y position.
Works only inside sketch functions?
Yes
Original Processing method
imageMode()

load-image

Arguments
[filename]
Docstring
Loads an image into a variable of type PImage. Four types of
images ( .gif, .jpg, .tga, .png) images may be loaded. To load
correctly, images must be located in the data directory of the
current sketch. In most cases, load all images in setup to preload
them at the start of the program. Loading images inside draw will
reduce the speed of a program.

The filename parameter can also be a URL to a file found online.

If an image is not loaded successfully, the null value is returned
and an error message will be printed to the console. The error
message does not halt the program, however the null value may cause
a NullPointerException if your code does not check whether the value
returned from load-image is nil.

Depending on the type of error, a PImage object may still be
returned, but the width and height of the image will be set to
-1. This happens if bad image data is returned or cannot be decoded
properly. Sometimes this happens with image URLs that produce a 403
error or that redirect to a password prompt, because load-image
will attempt to interpret the HTML as image data.
Works only inside sketch functions?
Yes
Original Processing method
loadImage()

mask-imageclj

Arguments
[img mask][mask]
Docstring
Masks part of an image from displaying by loading another image and
using it as an alpha channel.  This mask image should only contain
grayscale data, but only the blue color channel is used. The mask
image needs to be the same size as the image to which it is
applied.

If single argument function is used - masked image is sketch itself
or graphics if used inside with-graphics macro. If you're passing
graphics to this function - it works only with :p3d and :opengl renderers.

This method is useful for creating dynamically generated alpha
masks.
Works only inside sketch functions?
No
Original Processing method
PImage.mask()

no-tint

Arguments
[]
Docstring
Removes the current fill value for displaying images and reverts to
displaying images with their original hues.
Works only inside sketch functions?
Yes
Original Processing method
noTint()

request-image

Arguments
[filename]
Docstring
This function load images on a separate thread so that your sketch
does not freeze while images load during setup. While the image is
loading, its width and height will be 0. If an error occurs while
loading the image, its width and height will be set to -1. You'll
know when the image has loaded properly because its width and height
will be greater than 0. Asynchronous image loading (particularly
when downloading from a server) can dramatically improve
performance.
Works only inside sketch functions?
Yes
Original Processing method
requestImage()

tint

Arguments
[r g b][rgb alpha][rgb][r g b a]
Docstring
Sets the fill value for displaying images. Images can be tinted to
specified colors or made transparent by setting the alpha.

To make an image transparent, but not change it's color, use white
as the tint color and specify an alpha value. For instance,
tint(255, 128) will make an image 50% transparent (unless
colorMode() has been used).

The value for the parameter gray must be less than or equal to the
current maximum value as specified by colorMode(). The default
maximum value is 255.

Also used to control the coloring of textures in 3D.
Works only inside sketch functions?
Yes
Original Processing method
tint()

tint-float

Arguments
[gray][r g b][r g b a][gray alpha]
Docstring
Sets the fill value for displaying images. Images can be tinted to
specified colors or made transparent by setting the alpha.

To make an image transparent, but not change it's color, use white
as the tint color and specify an alpha value. For instance,
tint(255, 128) will make an image 50% transparent (unless
colorMode() has been used).

The value for the parameter gray must be less than or equal to the
current maximum value as specified by colorMode(). The default
maximum value is 255.

Also used to control the coloring of textures in 3D.
Works only inside sketch functions?
Yes
Original Processing method
tint()

tint-int

Arguments
[rgb alpha][rgb]
Docstring
Sets the fill value for displaying images. Images can be tinted to
specified colors or made transparent by setting the alpha.

To make an image transparent, but not change it's color, use white
as the tint color and specify an alpha value. For instance,
tint(255, 128) will make an image 50% transparent (unless
colorMode() has been used).

The value for the parameter gray must be less than or equal to the
current maximum value as specified by colorMode(). The default
maximum value is 255.

Also used to control the coloring of textures in 3D.
Works only inside sketch functions?
Yes
Original Processing method
tint()