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:

rgbaadd
rgbaaddB

Command line:

rgbaadd [background_file] foreground_file [ x_offset [ y_offset ] ]
rgbaaddB [foreground_file] background_file [ x_offset [ y_offset ] ]

Usage:

Rgbaadd, rgbaaddB 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.

Rgbaadd takes the first file as the background and the second as foreground. RgbaaddB 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).

Rgbaadd and rgbaaddB perform additive color mixing; taking the transparency levels into account, colors from the foreground and background are added. The net effect is much as if the images of two slide projectors are overlapped. Note that exceeding the limits of 24bpp is easy. Combining white with white will not result in brighter white; the output will be clamped to a maximim R, G and B value of 255.

Output will be clipped to the boundaries of the background image.

A brief behavior summary by example:
BackgroundAdditive colorresult
any colorwhite (#ffffff)white (#ffffff)
whiteany colorwhite (#ffffff)
graygraywhite (#ffffff)
any colorblack (#000000)background unchanged
red (#ff0000)green (#00ff00) yellow (#ffff00)
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 mix

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.

"rgbaadd text.rgba bolt.rgba"
text.rgba bolt.rgba rgbaadd text.rgba bolt.rgba stdout

"rgbaaddB text.rgba bolt.rgba"
text.rgba bolt.rgba rgbaaddB text.rgba bolt.rgba 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.