comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » invert_ct?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
invert_ct? [message #4578] Wed, 07 June 1995 00:00
dean is currently offline  dean
Messages: 55
Registered: March 1993
Member
There is h_eq_ct and gamma_ct, but is there a invert_ct to invert the
color table of a raster image. If not, what would be the simplist way
to invert the color table of an image with IDL?

Bonus question - what would be the simplist way of inverting the values
of an image itself?

Kelly Dean
CSU/CIRA
Re: invert_ct? [message #4579 is a reply to message #4578] Wed, 07 June 1995 00:00 Go to previous message
sjt is currently offline  sjt
Messages: 72
Registered: November 1993
Member
dean@phobos.cira.colostate.edu wrote:

: There is h_eq_ct and gamma_ct, but is there a invert_ct to invert the
: color table of a raster image. If not, what would be the simplist way
: to invert the color table of an image with IDL?

: Bonus question - what would be the simplist way of inverting the values
: of an image itself?

: Kelly Dean
: CSU/CIRA

Unless I seriously misunderstand what you are trying to do, it seems trivial:

tvlct,r,g,b,/get
tvlct, not r, not g, not b

Similarly for a byte image, (not image) will do a bitwise inversion. For
other types the action is the same but results are not quite as obvious
because other types are signed.

--
+------------------------+---------------------------------- --+---------+
| James Tappin, | School of Physics & Space Research | O__ |
| sjt@star.sr.bham.ac.uk | University of Birmingham | -- \/` |
| Ph: 0121-414-6462. Fax: 0121-414-3722 | |
+----------------------------------------------------------- --+---------+
Re: invert_ct? [message #4580 is a reply to message #4578] Wed, 07 June 1995 00:00 Go to previous message
knipp is currently offline  knipp
Messages: 68
Registered: January 1993
Member
In article 25me@yuma.ACNS.ColoState.EDU, dean@phobos.cira.colostate.edu writes:
>
> There is h_eq_ct and gamma_ct, but is there a invert_ct to invert the
> color table of a raster image. If not, what would be the simplist way
> to invert the color table of an image with IDL?
>
> Bonus question - what would be the simplist way of inverting the values
> of an image itself?
>
> Kelly Dean
> CSU/CIRA


Assuming 8-Bit images (8 Bits Per Pixel, grey values range 0 ... 255) try

invert_grey = 255b - original_grey




------------------------------------------------------------ ------------

Karlheinz Knipp
knipp@ipi.uni-hannover.de

------------------------------------------------------------ ------------
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: How to control plotting region when using !p.multi & X11 ???
Next Topic: No more plot_io, plot_oi, plot_oo calls in IDL version 4.0?????

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 14:32:48 PDT 2025

Total time taken to generate the page: 0.00538 seconds