NAME
affinewarp, correlate, histogram, crop – image processing tools

SYNOPSIS
image/affinewarp [ –Rqp ] [[ –s x y ] [ –r θ ] [ –t x y ] [ –S x y ] ... ]
image/correlate [ –cRp ] kernel [ denom ]
image/histogram [ file ]
image/crop [ –w ] [ file ]

DESCRIPTION
Image processing tools for image(6) files.

Affinewarp applies a sequence of affine image warping transformations to an image read from stdin and writes the result to stdout. The transformations happen in a left–handed coordinate system where the origin is the upper–left corner, and are applied in the order of the arguments. Its options: –R    Replicate the source image over the entire destination span. Without this option pixels that map outside the bounds of the image will be set to black; or transparent for images with an alpha channel.
q    Apply a bilinear filter when sampling the source for a higher–quality (albeit blurrier) result.
p    Enable parallelism.
s    Scale the picture x times along the x–axis and y times along the y–axis.
r    Rotate the image θ degrees.
t    Translate the picture x pixels along the x–axis and y pixels along the y–axis.
S    Shear the image x times along the x–axis and y times along the y–axis.

Correlate applies a correlation operation between an image read from stdin and a filtering kernel specified in a file of the same name, writing the result to stdout. It will look for the file in the current directory first, and if it doesn't find it, it will try in /lib/image/filter. A denom parameter controls the normalizing coefficient applied to the kernel before doing the operation, and it can be any real number; by default or when set to zero, it will use the sum of coefficients in the kernel. Its options:
c    Apply a convolution instead of a correlation.
R    Replicate the source image. This changes the behavior of the sampler when accessing pixels outside of the image boundaries, warping the probe point so that it falls back into the image (a toroidal map).
p    Enable parallelism.

Histogram reads an image from a given file or stdin, opens a minimal visualizer in the current window, and generates a histogram for each of its channels in an independent window.
When in the visualizer, use LMB to move the image around, scroll up/down or MMB to control zoom and RMB to open a menu with some extra options:
smoothen/sharpen
Toggle between a bilinear and nearest neighbour drawing filter (see the smooth parameter in affinewarp(2)).
select region
Sweep an area in the image and update the histograms based on its measurement.

Crop reads an image from a given file or stdin and opens a minimal visualizer in the current window (or a new one when using –w). The controls in the visualizer are the same as in histogram, with the button 3 (RMB) menu presenting the following options:
cropSelect a cropping area over the image. The resulting rectangle can be finely adjusted by pointing at any of its boundaries and sweeping while holding LMB.
write
Write the selected image region to stdout. If no region is selected the entire image will be used instead.

SOURCE
/sys/src/cmd/image

SEE ALSO
crop(1), resample(1), image(6)