blend

copy

display-filter

filter-shaderclj

get-pixel

image-filter

pixels

set-image

set-pixel

update-pixels

blend

Arguments
[x y width height dx dy dwidth dheight mode][src-img x y width height dx dy dwidth dheight mode][src-img dest-img x y width height dx dy dwidth dheight mode]
Docstring
Blends a region of pixels from one image into another with full alpha
channel support. If src is not specified it defaults to current-graphics.
If dest is not specified it defaults to current-graphics.

Note: blend-mode function is recommended to use instead of this one.

Available blend modes are:

:blend      - linear interpolation of colours: C = A*factor + B
:add        - additive blending with white clip:
                                          C = min(A*factor + B, 255)
:subtract   - subtractive blending with black clip:
                                          C = max(B - A*factor, 0)
:darkest    - only the darkest colour succeeds:
                                          C = min(A*factor, B)
:lightest   - only the lightest colour succeeds:
                                          C = max(A*factor, B)
:difference - subtract colors from underlying image.
:exclusion  - similar to :difference, but less extreme.
:multiply   - Multiply the colors, result will always be darker.
:screen     - Opposite multiply, uses inverse values of the colors.
:overlay    - A mix of :multiply and :screen. Multiplies dark values
              and screens light values.
:hard-light - :screen when greater than 50% gray, :multiply when
              lower.
:soft-light - Mix of :darkest and :lightest. Works like :overlay,
              but not as harsh.
:dodge      - Lightens light tones and increases contrast, ignores
              darks.
              Called "Color Dodge" in Illustrator and Photoshop.
:burn       - Darker areas are applied, increasing contrast, ignores
              lights. Called "Color Burn" in Illustrator and
              Photoshop.
Works only inside sketch functions?
Yes
Original Processing method
blend()

copy

Arguments
[src-img [sx sy swidth sheight] [dx dy dwidth dheight]][[sx sy swidth sheight] [dx dy dwidth dheight]][src-img dest-img [sx sy swidth sheight] [dx dy dwidth dheight]]
Docstring
Copies a region of pixels from the one image to another. If src-img
is not specified it defaults to current-graphics. If dest-img is not
specified - it defaults to current-graphics. If the source
and destination regions aren't the same size, it will automatically
resize the source pixels to fit the specified target region. No
alpha information is used in the process, however if the source
image has an alpha channel set, it will be copied as well. 
Works only inside sketch functions?
Yes
Original Processing method
copy()

display-filter

Arguments
[mode level][mode]
Docstring
Originally named filter in Processing Language.
Filters the display window with the specified mode and level.
Level defines the quality of the filter and mode may be one of the
following keywords:

:threshold - converts the image to black and white pixels depending
             if they are above or below the threshold defined by
             the level parameter. The level must be between
             0.0 (black) and 1.0 (white). If no level is specified,
             0.5 is used.
:gray      - converts any colors in the image to grayscale
             equivalents. Doesn't work with level.
:invert    - sets each pixel to its inverse value. Doesn't work with
             level.
:posterize - limits each channel of the image to the number of
             colors specified as the level parameter. The parameter can
             be set to values between 2 and 255, but results are most
             noticeable in the lower ranges.
:blur      - executes a Guassian blur with the level parameter
             specifying the extent of the blurring. If no level
             parameter is used, the blur is equivalent to Guassian
             blur of radius 1.
:opaque    - sets the alpha channel to entirely opaque. Doesn't work
             with level.
:erode     - reduces the light areas. Doesn't work with level.
:dilate    - increases the light areas.  Doesn't work with level.
Works only inside sketch functions?
Yes
Original Processing method
filter()

filter-shaderclj

Arguments
[shader-obj]
Docstring
Originally named filter in Processing Language.
Filters the display window with given shader (only in :p2d and :p3d modes).
Works only inside sketch functions?
Yes
Original Processing method
filter()

get-pixel

Arguments
[img x y w h][x y w h][img][][img x y][x y]
Docstring
Reads the color of any pixel or grabs a section of an image. If no
parameters are specified, a copy of entire image is returned. Get the
value of one pixel by specifying an x,y coordinate. Get a section of
the image by specifying an additional width and height parameter.
If the pixel requested is outside of the image window, black is returned.
The numbers returned are scaled according to the current color ranges,
but only RGB values are returned by this function. For example, even though
you may have drawn a shape with (color-mode :hsb), the numbers returned
will be in RGB.

Getting the color of a single pixel with (get x y) is easy, but not
as fast as grabbing the data directly using the pixels fn.

If no img specified - current-graphics is used.
Works only inside sketch functions?
Yes
Original Processing method
get()

image-filter

Arguments
[img mode][img mode level]
Docstring
Originally named filter in Processing Language.
Filters given image with the specified mode and level.
Level defines the quality of the filter and mode may be one of
the following keywords:

:threshold - converts the image to black and white pixels depending
             if they are above or below the threshold defined by
             the level parameter. The level must be between
             0.0 (black) and 1.0 (white). If no level is specified,
             0.5 is used.
:gray      - converts any colors in the image to grayscale
             equivalents. Doesn't work with level.
:invert    - sets each pixel to its inverse value. Doesn't work with
             level.
:posterize - limits each channel of the image to the number of
             colors specified as the level parameter. The parameter can
             be set to values between 2 and 255, but results are most
             noticeable in the lower ranges.
:blur      - executes a Guassian blur with the level parameter
             specifying the extent of the blurring. If no level
             parameter is used, the blur is equivalent to Guassian
             blur of radius 1.
:opaque    - sets the alpha channel to entirely opaque. Doesn't work
             with level.
:erode     - reduces the light areas. Doesn't work with level.
:dilate    - increases the light areas.  Doesn't work with level.
Works only inside sketch functions?
Yes
Original Processing method
PImage.filter()

pixels

Arguments
[img][]
Docstring
Array containing the values for all the pixels in the display
window or image. This array is therefore the size of the display window. If
this array is modified, the update-pixels fn must be called to update
the changes. Calls .loadPixels before obtaining the pixel array.
Works only inside sketch functions?
Yes
Original Processing method
pixels[]

set-image

Arguments
[x y src]
Docstring
Writes an image directly into the display window. The x and y
parameters define the coordinates for the upper-left corner of the
image.
Works only inside sketch functions?
Yes
Original Processing method
set()

set-pixel

Arguments
[x y c][img x y c]
Docstring
Changes the color of any pixel in the display window. The x and y
parameters specify the pixel to change and the color parameter
specifies the color value. The color parameter is affected by the
current color mode (the default is RGB values from 0 to 255).

Setting the color of a single pixel with (set x, y) is easy, but not
as fast as putting the data directly into pixels[].

This function ignores imageMode().

Due to what appears to be a bug in Apple's Java implementation, the
point() and set() methods are extremely slow in some circumstances
when used with the default renderer. Using :p2d or :p3d will fix the
problem. Grouping many calls to point or set-pixel together can also
help. (Bug 1094)
Works only inside sketch functions?
Yes
Original Processing method
set()

update-pixels

Arguments
[img][]
Docstring
Updates the display window or image with the data in the pixels array.
Use in conjunction with (pixels). If you're only reading pixels from
the array, there's no need to call update-pixels unless there are
changes.

Certain renderers may or may not seem to require pixels or
update-pixels. However, the rule is that any time you want to
manipulate the pixels array, you must first call pixels, and
after changes have been made, call update-pixels. Even if the
renderer may not seem to use this function in the current Processing
release, this will always be subject to change.
Works only inside sketch functions?
Yes
Original Processing method
updatePixels()