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

Home » Public Forums » archive » problem with writing a 2D image .tiff
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: problem with writing a 2D image .tiff [message #53796 is a reply to message #53502] Thu, 03 May 2007 10:09 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
aleks.franca@gmail.com writes:

> ok. I have the solution to my problem. I work with grayscale images
> and they have only 6 diferent pixel values. From 0 to 6. I can
> visualize the image because I created a 6-level-colortable to
> visualize, but when I save it, I cannot see the image because the
> pixel values are very low.
> To save it the way I can actually see the image I have to use the
> command:
>
> image = bytscl(image)
>
> Now I'm confused. Why did that work?

Because now your values are not 0-5, they are this:

IDL> Print, Bytscl(Indgen(6))
0 51 102 153 204 255

And these values show up in the color table you are
using. But this is NOT what you want to do.

What you WANT to do, is load the six colors you are
using to display your image, and scale your image
into those six colors. Something like this:

LoadCT, 33, NCOLORS=6, BOTTOM=1
TV, BytScl(image, TOP=5) + 1B

In general, if you care about colors (and who doesn't!?),
then you should forget you ever heard about TVSCL. :-)

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: HISTOGRAM and string data
Next Topic: how to force idl to export data in one line?

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

Current Time: Wed Oct 29 19:21:14 PDT 2025

Total time taken to generate the page: 0.00444 seconds