Re: Tiff images with "short" Palette? [message #73864] |
Tue, 07 December 2010 14:21  |
Matt[2]
Messages: 69 Registered: March 2007
|
Member |
|
|
> Yes, I think a "color vector" is 256 elements in length
> whether you fill 2 or 100 colors.
This is the crux. Can I make a "color vector" that has a length of 2
(or 3 or 5)?. If not, is that because of limitations with IDL, or
because of limitations to the TIFF spec. I've given the spec a
glance, and I can't see that the palette must be 256 colors.
> Hard to say if it is against the spec, I've never read it.
> But I don't think you are going to be able to make what you
> want in IDL. At least I don't know any way to.
Yup, so now I'm looking for alternatives.
> P.S. Hard to fault ArcView for loading the color table
> vectors. That's what I would do, too. :-(
No, that's exactly right, if your palette has 256 colors, load them
all. But I really don't want a palette with 256 colors.
|
|
|
Re: Tiff images with "short" Palette? [message #73865 is a reply to message #73864] |
Tue, 07 December 2010 12:32   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Matt writes:
> The problem is that when someone opens my geotiffs in arcview, a whole
> black palette is displayed as 253 colors that aren't used. It's not
> just the return vector that looks like it has 255 elements in it, I
> believe the tiff file is stored with 255 when I've only asked it to
> store 2 values.
Zeros are more likely, don't you think? Especially
if things turn black on the other end.
Yes, I think a "color vector" is 256 elements in length
whether you fill 2 or 100 colors.
> Is this too much to ask for? Is it against the spec?
Hard to say if it is against the spec, I've never read it.
But I don't think you are going to be able to make what you
want in IDL. At least I don't know any way to.
Cheers,
David
P.S. Hard to fault ArcView for loading the color table
vectors. That's what I would do, too. :-(
--
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.")
|
|
|
|
|
Re: Tiff images with "short" Palette? [message #73953 is a reply to message #73864] |
Wed, 08 December 2010 07:26  |
jeanh
Messages: 79 Registered: November 2009
|
Member |
|
|
On 07/12/2010 5:21 PM, Matt wrote:
>> Yes, I think a "color vector" is 256 elements in length
>> whether you fill 2 or 100 colors.
>
> This is the crux. Can I make a "color vector" that has a length of 2
> (or 3 or 5)?. If not, is that because of limitations with IDL, or
> because of limitations to the TIFF spec. I've given the spec a
> glance, and I can't see that the palette must be 256 colors.
>
>> Hard to say if it is against the spec, I've never read it.
>> But I don't think you are going to be able to make what you
>> want in IDL. At least I don't know any way to.
>
> Yup, so now I'm looking for alternatives.
Do you have Envi? ... maybe ENVI_WRITE_ENVI_FILE , with the fileType=
set to "tiff" value behaves differently... it specifically asks for a
lookup table, which is supposed to be 3*number of classes
Jean
|
|
|
Re: Tiff images with "short" Palette? [message #73959 is a reply to message #73864] |
Wed, 08 December 2010 05:35  |
Bruce Bowler
Messages: 128 Registered: September 1998
|
Senior Member |
|
|
On Tue, 07 Dec 2010 14:21:12 -0800, Matt set fingers to keyboard and
typed:
>> Yes, I think a "color vector" is 256 elements in length whether you
>> fill 2 or 100 colors.
>
> This is the crux. Can I make a "color vector" that has a length of 2
> (or 3 or 5)?. If not, is that because of limitations with IDL, or
> because of limitations to the TIFF spec. I've given the spec a glance,
> and I can't see that the palette must be 256 colors.
>
>> Hard to say if it is against the spec, I've never read it. But I don't
>> think you are going to be able to make what you want in IDL. At least I
>> don't know any way to.
>
> Yup, so now I'm looking for alternatives.
>
>> P.S. Hard to fault ArcView for loading the color table vectors. That's
>> what I would do, too. :-(
>
> No, that's exactly right, if your palette has 256 colors, load them all.
> But I really don't want a palette with 256 colors.
From a *quick* read of http://partners.adobe.com/public/developer/en/tiff/
TIFF6.pdf, it would appear that it's more a limitation of IDL, and
depending on which section of the spec you read it might be partially a
limitation of the spec, which at one point defines the size of the color
table as 3*2^BitsPerSample (seems to say you can have whatever size table
you'd like), but in another section (specifically talking about grey scale
images) says that BitsPerSample can either be 4 or 8 and somewhere says
that the default for BitsPerSample is 1 (which is neither 4 nor 8 :-)
At this point, I'd point the "flying fickle finger of fault" mostly in the
direction of IDL.
Bruce
|
|
|