Re: Color BMP problems [message #11289] |
Sat, 28 March 1998 00:00 |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
James Fulton (jfulton@impulse.net) writes:
> I use the following lines to make a bitmap file of the active window and the
> resulting file seems to have different colors from the original when I view
> the file.
>
> TVLCT, R, G, B, /GET
> image = TVRD()
> WRITE_BMP, 'temp.bmp', image, R, G, B
>
> I am using Win95 with the screen set at 16 bits. I am also using the
> supplied color files that comes with IDL. Any ideas why?
Sure enough, the image you are getting back from Read_BMP
and the original image contain different values. But
in this case Write_BMP has nothing to do with it. TVRD
is the culprit.
Try this when your display is set to 16-bit (thousands
of colors):
loadct, 0
image = Dist(200)
window, 0, xsize=200, ysize=200
tv, image
test = TVRD()
window, 1, xsize=200, ysize=200
tv, test
You can already see slight difference in the images. On my
display the second test image seems to have some green-tinted
colors in it. Just to see that these differences are real,
type this:
tvscl, image - test
You would expect a black display, but that is not what you
get. This is the source of your troubles.
I get the same result in IDL 5.0.3 and 5.1 beta 2.
I don't know what to tell you, except that RSI has NEVER
claimed to support 16-bit color. It is only under the
rarest occasions that I ever run IDL in anything but
8-bit mode. When I do venture forth into 24-bit color space,
I am almost always sorry I did. :-(
I did hear from reliable sources that starting in IDL 5.1
24-bit color will be handled the same on ALL platforms.
This, at least, is good news. :-)
Cheers,
David
-----------------------------------------------------------
David Fanning, Ph.D.
Fanning Software Consulting
E-Mail: davidf@dfanning.com
Phone: 970-221-0438
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|