RLECOMP(1)RLECOMP(1)NAMErlecomp - Digital image compositor
SYNOPSISrlecomp [ -o outfile ] Afile operator Bfile
DESCRIPTIONrlecomp implements an image compositor based on presence of an alpha,
or matte channel the image. This extra channel usually defines a mask
which represents a sort of a cookie-cutter for the image. This is the
case when alpha is 255 (full coverage) for pixels inside the shape,
zero outside, and between zero and 255 on the boundary. If Afile or
Bfile is just a single -, then rlecomp reads that file from the stan‐
The operations behave as follows (assuming the operation is "A operator
over The result will be the union of the two image shapes, with A
obscuring B in the region of overlap.
in The result is simply the image A cut by the shape of B. None of
the image data of B will be in the result.
atop The result is the same shape as image B, with A obscuring B
where the image shapes overlap. Note this differs from over
because the portion of A outside B's shape does not appear in
out The result image is image A with the shape of B cut out.
xor The result is the image data from both images that is outside
the overlap region. The overlap region will be blank.
plus The result is just the sum of the image data. Output values are
clipped to 255 (no overflow). This operation is actually inde‐
pendent of the alpha channels.
minus The result of A - B, with underflow clipped to zero. The alpha
channel is ignored (set to 255, full coverage).
diff The result of abs(A - B). This is useful for comparing two very
add The result of A + B, with overflow wrapping around (mod 256).
The result of A - B, with underflow wrapping around (mod 256).
The add and subtract operators can be used to perform reversible
SEE ALSOurt(1), RLE(5),
"Compositing Digital Images", Porter and Duff, Proceedings of SIGGRAPH
Rod Bogart and John W. Peterson
The other operations could be optimized as much as over is.
Rlecomp assumes both input files have the same number of channels.
4th Berkeley Distribution December 20, 1986 RLECOMP(1)