Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

pdl::imagergb(3) [suse man page]

ImageRGB(3)						User Contributed Perl Documentation					       ImageRGB(3)

NAME
PDL::ImageRGB -- some utility functions for RGB image data handling DESCRIPTION
Collection of a few commonly used routines involved in handling of RGB, palette and grayscale images. Not much more than a start. Should be a good place to exercise some of the thread/map/clump PP stuff. Other stuff that should/could go here: o color space conversion o common image filters o image rebinning SYNOPSIS
use PDL::ImageRGB; FUNCTIONS
cquant quantize and reduce colours in 8-bit images ($out, $lut) = cquant($image [,$ncols]); This function does color reduction for <=8bit displays and accepts 8bit RGB and 8bit palette images. It does this through an interface to the ppm_quant routine from the pbmplus package that implements the median cut routine which intellegently selects the 'best' colors to represent your image on a <= 8bit display (based on the median cut algorithm). Optional args: $ncols sets the maximum nunmber of colours used for the output image (defaults to 256). There are images where a different color reduction scheme gives better results (it seems this is true for images containing large areas with very smoothly changing colours). Returns a list containing the new palette image (type PDL_Byte) and the RGB colormap. interlrgb Make an RGB image from a palette image and its lookup table. $rgb = $palette_im->interlrgb($lut) Input should be of an integer type and the lookup table (3,x,...). Will perform the lookup for any N-dimensional input pdl (i.e. 0D, 1D, 2D, ...). Uses the index command but will not dataflow by default. If you want it to dataflow the dataflow_forward flag must be set in the $lut piddle (you can do that by saying $lut->set_dataflow_f(1)). rgbtogr Converts an RGB image to a grey scale using standard transform $gr = $rgb->rgbtogr Performs a conversion of an RGB input image (3,x,....) to a greyscale image (x,.....) using standard formula: Grey = 0.301 R + 0.586 G + 0.113 B bytescl Scales a pdl into a specified data range (default 0-255) $scale = $im->bytescl([$top]) By default $top=255, otherwise you have to give the desired top value as an argument to "bytescl". Normally "bytescl" doesn't rescale data that fits already in the bounds 0..$top (it only does the type conversion if required). If you want to force it to rescale so that the max of the output is at $top and the min at 0 you give a negative $top value to indicate this. BUGS
This package doesn't yet contain enough useful functions! AUTHOR
Copyright 1997 Christian Soeller <c.soeller@auckland.ac.nz> All rights reserved. There is no warranty. You are allowed to redistribute this software / documentation under certain conditions. For details, see the file COPYING in the PDL distribution. If this file is separated from the PDL distribution, the copyright notice should be included in the file. perl v5.12.1 2010-07-05 ImageRGB(3)

Check Out this Related Man Page

TIFFGT(1)						      General Commands Manual							 TIFFGT(1)

NAME
tiffgt - display an image stored in a TIFF file (Silicon Graphics version) SYNOPSIS
tiffgt [ options ] input.tif ... DESCRIPTION
tiffgt displays one or more images stored using the Tag Image File Format, Revision 6.0. Each image is placed in a fixed size window that the user must position on the display (unless configured otherwise through X defaults). If the display has fewer than 24 bitplanes, or if the image does not warrant full color, then RGB color values are mapped to the closest values that exist in the colormap (this is done using the rgbi routine found in the graphics utility library -lgutil.) tiffgt correctly handles files with any of the following characteristics: BitsPerSample 1, 2, 4, 8, 16 SamplesPerPixel 1, 3, 4 (the 4th sample is ignored) PhotometricInterpretation 0 (min-is-white), 1 (min-is-black), 2 (RGB), 3 (palette), 6 (YCbCr) PlanarConfiguration 1 (contiguous), 2 (separate) Orientation 1 (top-left), 4 (bottom-left) Data may be organized as strips or tiles and may be compressed with any of the compression algorithms supported by the libtiff(3) library. For palette images (PhotomatricInterpretation=3), tiffgt inspects the colormap values and assumes either 16-bit or 8-bit values according to the maximum value. That is, if no colormap entry greater than 255 is found, tiffgt assumes the colormap has only 8-bit values; other- wise it assumes 16-bit values. This inspection is done to handle old images written by previous (incorrect) versions of libtiff. tiffgt can be used to display multiple images one-at-a-time. The left mouse button switches the display to the first image in the next file in the list of files specified on the command line. The right mouse button switches to the first image in the previous file in the list. The middle mouse button causes the first image in the first file specified on the command line to be displayed. In addition the following keyboard commands are recognized: b Use a PhotometricIntepretation of MinIsBlack in displaying the current image. l Use a FillOrder of lsb-to-msb in decoding the current image. m Use a FillOrder of msb-tolmsb in decoding the current image. c Use a colormap visual to display the current image. r Use a true color (24-bit RGB) visual to display the current image. w Use a PhotometricIntepretation of MinIsWhite in displaying the current image. W Toggle (enable/disable) display of warning messages from the TIFF library when decoding images. E Toggle (enable/disable) display of error messages from the TIFF library when decoding images. z Reset all parameters to their default settings (FillOrder, PhotometricInterpretation, handling of warnings and errors). PageUp Display the previous image in the current file or the last image in the previous file. PageDown Display the next image in the current file or the first image in the next file. Home Display the first image in the current file. End Display the last image in the current file (unimplemented). OPTIONS
-c Force image display in a colormap window. -d Specify an image to display by directory number. By default the first image in the file is displayed. Directories are numbered starting at zero. -e Enable reporting of error messages from the TIFF library. By default tiffgt silently ignores images that cannot be read. -f Force tiffgt to run as a foreground process. By default tiffgt will place itself in the background once it has opened the requested image file. -l Force the presumed bit ordering to be LSB to MSB. -m Force the presumed bit ordering to be MSB to LSB. -o Specify an image to display by directory offset. By default the first image in the file is displayed. Directories offsets may be specified using C-style syntax; i.e. a leading ``0x'' for hexadecimal and a leading ``0'' for octal. -p Override the value of the PhotometricInterpretation tag; the parameter may be one of: miniswhite, minisblack, rgb, palette, mask, separated, ycbcr, and cielab. -r Force image display in a full color window. -s Stop on the first read error. By default all errors in the input data are ignored and tiffgt does it's best to display as much of an image as possible. -w Enable reporting of warning messages from the TIFF library. By default tiffgt ignores warning messages generated when reading an image. -v Place information in the title bar describing what type of window (full color or colormap) is being used, the name of the input file, and the directory index of the image (if non-zero). By default, the window type is not shown in the title bar. BUGS
Images wider and taller than the display are silently truncated to avoid crashing old versions of the window manager. SEE ALSO
tiffdump(1), tiffinfo(1), tiffcp(1), libtiff(3) October 15, 1995 TIFFGT(1)
Man Page