tdarnell@hao.ucar.edu (Tony Darnell) writes
> I am having some difficulty saving 24 bit TIFF files and was wondering
> if anyone out there had a solution for me... I am constructing 24 bit
> images of solar image data and am trying to save the resulting image
> to a tiff file using TVRD(TRUE=1)...
> Viewing the image in IDL
> gives me exactly what I was expecting, however, once I view the image in an
> external viewer, such as xv, the image appears to have lost some information
> because it looks lossy.
Let me give a 3 part answer:
1. Possible problems with xv and other display
programs that could appear to cause your
problem.
2. How to write a 24 bit screen window to a
TIFF file.
3. By the way, anyone looking for an experienced
programmer?
===============================================
There are a number of potential problems with xv
(and other display programs) that could be causing
your problem. E.G., if the image is larger than
the xv display window, xv would sub-sample it,
producing interesting side effects. Other side
effects can result from a image that is smaller
than the xv display window, resulting from
uneven pixel replication.
Many other display programs would actually create an
8 bit window, drop those colors already in use by the
system, and dither.
I use IDL or WAVE for display because I know that I
can control exactly what they do, if I work at it,
and am willing to trade off some speed. E-mail me
if you want a junky but usable image/animation display
program, which can also extract other images and
sub-images (including TIFF), etc.
============================================================ =====
I'm sure David Fanning's method of dealing with 8 bit
images works, but if you really want to read 24 bit color
from the screen, and you want things to be more portable
on multiple systems, you might create the window (which
should be your FIRST window) with:
device,true=24
window,... ,colors=2L^24
Just as a check that you have a 24 bit window,
print,!d.n_colors,2L^24
They should be the same.
Then place your stuff in the window:
tv,...
etc.
Then read it in, and write to a TIFF file.
It is important to use top-to-bottom storage
order, so that most other TIFF viewers can read it right.
In IDL you could do this with:
A=tvrd(0,0,!d.x_vsize,!d.y_vsize,true=1)
tiff_write,'junk.tif',reverse(A,3),1
In PV-WAVE, you could use use:
A=tvrd(0,0,!d.x_vsize,!d.y_vsize,true=3)
for i=0,2 do A(*,*,i)=reverse(reform(A(*,*,i)),0)
if dc_write_tiff('junk.tif',A,class='RGB') ne 0 then $
stop,'*****Bad dc_write_tiff'
=======================================================
I have a confession. Part of my real reason for
responding is that I am looking for a job, since
funding for me is indefinite as of October 1.
If anyone out there who is reading this is looking for
an experienced IDL/PV-WAVE/Fortran/C scientific
programmer, with knowledge of image processing and
remote sensing, I am available.
(BTW, I am on leave the week of 8/18.)
I know, wrong newsgroup. Shame on me!
At least I contributed something useful.
(-:
------------------------------------------------------------ -
Mitchell R Grunes, grunes@imsy1.nrl.navy.mil. Opinions are mine alone.
------------------------------------------------------------ -
Mitchell R Grunes, grunes@imsy1.nrl.navy.mil. Opinions are mine alone.
|