Color BMP problems [message #11290] |
Sat, 28 March 1998 00:00  |
James Fulton
Messages: 2 Registered: March 1998
|
Junior Member |
|
|
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?
|
|
|
Re: Color BMP problems [message #11507 is a reply to message #11290] |
Wed, 01 April 1998 00:00  |
dwc
Messages: 2 Registered: April 1998
|
Junior Member |
|
|
In article <6fjn2o$6kh$1@sienna.impulse.net>, jfulton@impulse.net says...
>
> 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?
>
This may be due to the Microsoft primary ordering which is BGR not RGB. The
following code works fine on 16bit/24bit displays under Win95:
save_bmp = 'foobar.bmp'
bmp_image = TVRD(/TRUE)
; change from RGB to BGR for .BMP
chan_temp = bmp_image[0,*,*]
bmp_image[0,*,*] = bmp_image[2,*,*]
bmp_image[2,*,*] = chan_temp
write_bmp, save_bmp, TEMPORARY(bmp_image)
I have found that Truecolor graphics work great under 5.0.2 - I avoid using
color tables and color indexes as much as possible.
Dave Coulter
dwc@nel.newmont.com
|
|
|
Re: Color BMP problems [message #11511 is a reply to message #11290] |
Tue, 31 March 1998 00:00  |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Dave Coulter (dwc@nel.newmont.com) writes:
> This may be due to the Microsoft primary ordering which is BGR not RGB. The
> following code works fine on 16bit/24bit displays under Win95:
>
> save_bmp = 'foobar.bmp'
> bmp_image = TVRD(/TRUE)
> ; change from RGB to BGR for .BMP
> chan_temp = bmp_image[0,*,*]
> bmp_image[0,*,*] = bmp_image[2,*,*]
> bmp_image[2,*,*] = chan_temp
> write_bmp, save_bmp, TEMPORARY(bmp_image)
>
> I have found that Truecolor graphics work great under 5.0.2 - I avoid using
> color tables and color indexes as much as possible.
Now HERE is something I didn't know and wouldn't have figured
out in a long, long time!
Thanks, Dave.
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/
|
|
|