Newsgroups: sci.image.processing
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!news.mathworks.com!news.alpha.net!uwm.edu!cs.utexas.edu!swrinde!pipex!sunic!news.lth.se!news.lu.se!astol!ralph
From: ralph@astol.astro.lu.se (Ralph Snel)
Subject: Re: XV -viewer & Color
Message-ID: <1995Feb22.081601.2313@nomina.lu.se>
Sender: ralph@astol (Ralph Snel)
Nntp-Posting-Host: nastol.astro.lu.se
Organization: Lund Observatory
References: <3hq91u$elh@news.service.uci.edu> <3hqs8f$2ei@nouvelles.dreo.dnd.ca> <ROLAND.95Feb17151242@zith.sics.se>
Date: Wed, 22 Feb 1995 08:16:01 GMT
Lines: 35

In article <ROLAND.95Feb17151242@zith.sics.se>, roland@sics.se (Roland Karlsson) writes:
> 
> >can anyone tell me how to use xv to display a grey-scale image in some kind
> >of rainbow scale. I.e. pixel value 1 is purple & pixel value 255 is red.
> >The standard colormap option doesn't seem to do much.
> 
> 
> Here is a pbm-plus program that do nearly what you want.  Actually, it
> is more complicated than you want.  This programs assures that black
> is black and white is white.  So, a hack is needed to simplify it.
> 
In the pbmplus package there's a program called pgmtoppm. That does exactly
what you want. From the man-page:

 NAME
      pgmtoppm - colorize a portable graymap into a portable pixmap

 SYNOPSIS
      pgmtoppm colorspec [pgmfile]
      pgmtoppm colorspec1-colorspec2 [pgmfile]
      pgmtoppm -map mapfile [pgmfile]

 DESCRIPTION
      Reads a portable graymap as input.  Colorizes it by multiplying the
      the gray values by specified color or colors, and produces a portable
      pixmap as output.

      If only one color is specified, black in the pgm file stays black and
      white in the pgm file turns into the specified color in the ppm file.
      If two colors (separated by a dash) are specified, then black gets
      mapped to the first color and white gets mapped to the second.
[...]

Ralph
ralph@astro.lu.se
