RGBA32

Index:
ppm2rgba
rgba2ppm
rgbaadd
rgbaaddB
rgbaautocrop
rgbadither
rgbafade
rgbamerge
rgbamergeB
rgbaquant
rgbascale
rgbascaleB
rgbascaleF
rgbasub
rgbasubB
rgbatrans

trouble-
shooting

the RGBA32 manual and style guide:

rgbasub
rgbasubB

Command line:

rgbasub [background_file] foreground_file [ x_offset [ y_offset ] ]
rgbasubB [foreground_file] background_file [ x_offset [ y_offset ] ]

Usage:

Rgbasub and rgbasubB are slight variations of the same utility. They take two input images; both may be specified on the command line, or one will be taken from stdin, and the second must be specified on the command line. Filenames must appear before numeric arguments.

Rgbasub takes the first file as the background and the second as foreground. RgbasubB takes the files in opposite order; foreground then background. Lastly, an x and y offset may be specified to move the origin of the foreground image with respect to the background (the offset values may be negative).

Rgbasub and rgbasubB perform subtractive image filtering; taking the transparency levels into account, the foreground image acts as a filter, slectively transmitting or blocking colors and portions of the background image.

A brief behavior summary by example:
Backgroundsubtractive colorresult
any colorblack (#000000)black (#000000)
blackany colorblack (#000000)
graygraydark grey
any colorwhite (#ffffff)background unchanged
red (#ff0000)green (#00ff00) black (#000000)
any color (opaque)any color (transparent)background unchanged (opaque)
any color (transparent)any color (opaque)foreground color (opaque)
any color (translucent)any color (translucent)translucent subtraction

Note that output will be clipped to the boundaries of the background image.

Examples:

Note that the images as shown in the browser are GIFs; the actual rgba output is converted to GIF such that the browser can display it. Warning; Web browsers running on less than a 16 bit display (less than 65K colors) will almost certainly substitute colors wildly and/or dither the below images. This will degrade the image quality considerably.

"rgbasub text.rgba 20 15"
stdin (no blue) text.rgba (antialiased with transparent background) rgbasub text.rgba 20 15 stdout

Bugs:

In the interest of simple command-line parsing, all arguments that begin with a digit, decimal point or unary minus are considered to be numeric arguments (not filenames). Therefore, the input file cannot begin with any of these else it would be mistakenly taken as the first numeric argument.


These pages are copyright (C) 1994-1997 Xiphophorus. All rights reserved.