XPM Tools
Version 0.99
Copyright (C) 1998,2000 Taiji Yamada <taiji@aihara.co.jp>
[Back] [Japanese Page]
xpmextramask
xpmextramask [-m mask_value] [-n none_value] <
input.xpm
> output.xpm
xpmextramask extracts transparent pixels from a XPM file which includes
transparent pixels, and outputs a mask image of XPM format.
% xpmextramask < .xpm
> .xpm
% xpmextramask -m None -n black < .xpm
> .xpm
xpmmergemask
xpmmergemask [-m mask_file] < input.xpm > output.xpm
xpmmergemask merges an input image of XPM format with a specified
mask image which includes transparent pixels, and outputs a XPM image.
% xpmmergemask -m .xpm
< .xpm
> .xpm
A mask image is not always contructed of only transparent and mask pixels.
% xpmmergemask -m .xpm
< .xpm
> .xpm
As an example of combination of xpmextramask and xpmmergemask,
keep trnasparent pixels, use netpbm command tools and put back transparent
pixels as follows:
% convert -sample 16x16 .xpm .xpm
% xpmtoppm < .xpm
|pnmscale -xsize 16 -ysize 16|ppmquant 16|ppmtoxpm > .xpm
% xpmmergemask -m .xpm
< .xpm
> .xpm
xpmnamecolor
xpmnamecolor [[-s rgb.txt] -d rgb.txt] [-u] [-v]
< input.xpm > output.xpm
xpmnamecolor replaces RGB color values with color name in RGB color
database which is indicated to /usr/X11R6/lib/X11/rgb.txt as default.
'-d <filename>' option sets RGB database file to <filename>. If a
color value is missing in color database, xpmnamecolor doesn't replace
the color as default, but xpmnamecolor replaces the color value
with the closest color name with '-u' option. With '-v' option, this outputs
color value like '#c8c8c8' in the place of color name.
% xpmnamecolor -u < .xpm
> .xpm
xpmnamecolor is available for another color reducing method of 'convert'
command with '-colors' option of ImageMagick, 'ppmquant' command of netpbm
and so on. All of images shares a RGB color database and are replaced to
the color names by xpmnamecolor with '-u' so that many colors to
use are reduced in using the whole images.
Questions or comments regarding this service? taiji@aihara.co.jp.
Copyright (C) 1998,2000 Taiji Yamada, All rights reserved.