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: rgbatrans

Command line:

rgbatrans [input_file] [ { #RGB_color | color_index } [ opaqueness] ]

Usage:

Rgbatrans is used to set one or more colors in an image to completely transparent, or to a specified opaqueness level. Rgbatrans can take input either from stdin or from a file specified on the command line. If a filename appears on the command line, stdin will not be checked for input. Filenames must appear before numeric arguments.

The first optional numeric argument specifies which color to set to an opaquaness level; the color may be specified by what order it appears in the image (eg, starting counting from zero, the third color that appears when scanning left-to-right, top-to-bottom), as a six hex-digit X style RGB value (eg, #a0ffff), or '-1' specifying every pixel in the image.

The last optional argument specifiesthe opaqueness level to which to set the selected pixels. The value may be a floating point number (0. specifies totally transparent, 1. totally opaque) or a percentage (0% transparent, 100% opaque). Note that this value specifies an absolute opaqueness level; the original transparency level of a pixel is not considered when setting the new level (unselected pixel colors are unaffected). Also, transparent pixels still remember their color; it is simply not visible. It still functions when considering colormap operations.

If not explicitly specified otherwise, rgbatrans will set all occurences of the color of the first pixel it sees (top left pixel) to totally transparent. Output is directed to stdout and errors to stderr.

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.

rgbatrans | rgbatrans 1 | rbatrans 2
stdin
(3 color background)
rgbatrans rgbatrans 2 rgbatrans 3 stdout

transparent, anti-aliased mixing
stdin rgbatrans rgbascale 50% rgbamergeB bolt.rgba 30 50 stdout

The following differs from "rgbafade 50% 50% 50% 50%" in that rgbafade is done in addition to any pre-existing transparency. Rgbatrans below is setting an absolute transparency value.

translucent
stdin rgbatrans -1 50% 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.