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:

rgbamerge
rgbamergeB

Command line:

rgbamerge [background_file] foreground_file [ x_offset [ y_offset ] ]
rgbamergeB [foreground_file] background_file [ x_offset [ y_offset ] ]

Usage:

Rgbamerge and rgbamergeB 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.

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

Rgbamerge and rgbamergeB perform averaged image mixing; taking the transparency levels into account, the foreground and background images are mixed; areas of the background show through transparent areas of the foreground. Where the foreground is translucent, the colors are mixed. The most obvious use is adding an antialiased image (in an otherwise transparent image) onto a background. Because the antialiasing and mixing makes proper use of the alpha channels, the two images can be combined without color artifacts at the edges.

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.

"rgbamerge A.rgba f.rgba"
A.rgba (antialiased with transparent background) f.rgba (antialiased with transparent background) rgbamerge A.rgba f.rgba stdout

"rgbamergeB bolt.rgba 10 30"
stdin (antialiased with transparent background) bolt.rgba rgbamergeB bolt.rgba 10 30 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.