Re: 16 bit / 8 bit depth colors on the mac [message #7374 is a reply to message #7309] |
Thu, 07 November 1996 00:00   |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Peter Mason writes:
> It just occurred to me that there is a way to view an unsigned int (16-bit)
> image without having to convert to LONGs. (Memory may sometimes be an
> issue, especially for large multiband images.)
> e.g.,
> image = INTARR(256, 256)
> READU, lun, image ;read in the unsigned int image
> f=fix(32768) ;F is a signed short int, value = -32768
> image=temporary(image)+f ;remap "unsigned" values to monotonically
> ;increasing signed values
> tvscl,image
>
> The problem with viewing unsigned int data as if they are signed is that
> values 32768 .. 65535 get interpreted (backwards!) as -32768 .. -1.
> (Values 0 .. 32767 are ok.)
>
> By subtracting 32768 from the data we're mapping to an acceptable signed
> int range:
> 0 .. 32767 => -32768 .. -1
> 32768 .. 65535 => 0 .. 32767
> So any operation which is concerned with the RELATIVE data range (like
> TVSCL or BYTSCL) stands a chance of working on the remapped data.
Umm, perhaps. The problem with this Peter, at least as I see it, is that
there are too many people already who think when they view an image
that the are "seeing their data". They are not. They are viewing an
*abstraction* of their data. Namely, their data displayed in the number
of colors available on their display device.
This will encourage people to work with that abstraction as if it were
the real thing. I'm always leary of this, because I think it leads
naturally to bad decisions about what the data means. I would rather
take the extra hit on bytes for the long integers and know what my
"real" data is.
David
*************************************************
* David Fanning, Ph.D.
* 2642 Bradbury Court, Fort Collins, CO 80521
* Phone: 970-221-0438 Fax: 970-221-4762
* E-Mail: davidf@dfanning.com
*
* Sometimes I go about pitying myself, and all along my
* soul is being blown by great winds across the sky.
* -- Ojibway saying
************************************************
|
|
|