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

Home » Public Forums » archive » Tiff images with "short" Palette?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Tiff images with "short" Palette? [message #73868] Tue, 07 December 2010 11:50 Go to previous message
Matt[2] is currently offline  Matt[2]
Messages: 69
Registered: March 2007
Member
So I'm really creating these great geotiffs in IDL, but I'm having
problems with the palettes that are attached.

I think I've boiled my problem down to the way I'm making my tif
files. For the sake of argument, I am creating the tif with a 2
element color palette, but IDL appears to be creating a 255 color
palette in the background and storing a bunch of information that I
don't want. Here's some sample code of exactly what I'm doing.

Does anyone know of a way to get around this problem?


pro geotiff_problem
compile_opt idl2, logical_predicate

device, decomposed = 0
;; Load a rainbow.
loadct, 34

;; Set 0 and 1 to black and white
red = [ 0, 255 ]
green = [ 0, 255 ]
blue = [ 0, 255 ]
tvlct, red, green, blue

file = FILEPATH( SUBDIR = [ 'examples', 'data' ], 'worldelv.dat' )
data = BYTARR( 360, 360 )
OPENR, lun, file, /GET_LUN
READU, lun, data
FREE_LUN, lun

;; create a mask of 0/1 of rough outlines of coasts.
mask = (data gt 126)

;; Write a tif with 2 colors.
write_tiff, 'sample.tif', mask, red = red, $
green = green, blue = blue
;; Read a tif of 255 colors
tif = read_tiff( 'sample.tif', red_out, blue_out, green_out )
help, red_out

end
[Message index]
 
Read Message
Read Message
Previous Topic: Re: Stupid question regarding BUFFER keyword in NG output.....
Next Topic: Re: Tiff images with "short" Palette?

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

Current Time: Fri Oct 10 14:52:28 PDT 2025

Total time taken to generate the page: 0.72241 seconds