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

Home » Public Forums » archive » Re: Write_bmp procedure changes RGB color order to BGR for input image
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Write_bmp procedure changes RGB color order to BGR for input image [message #22569] Tue, 14 November 2000 00:00
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Craig Markwardt (craigmnet@cow.physics.wisc.edu) writes:

> The differences are, (a) we aren't paying you like $2 billion for your
> software (much to your distress I'm sure);

I'd get over it though, if people would buy a book.

> and (b) RSI should be the bastions of IDL programming :-)

Yeah, and Microsoft should be the leader in software
Quality Control. :-)

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: Write_bmp procedure changes RGB color order to BGR for input image [message #22570 is a reply to message #22569] Tue, 14 November 2000 00:00 Go to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
davidf@dfanning.com (David Fanning) writes:

> Craig Markwardt (craigmnet@cow.physics.wisc.edu) writes:
>
>> The disappointment is that this lame code comes from RSI.
>
> Yikes! I'm going to go have another look at my lame code
> right now. :-(

The differences are, (a) we aren't paying you like $2 billion for your
software (much to your distress I'm sure); and (b) RSI should be the
bastions of IDL programming :-)

Craig

--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
Re: Write_bmp procedure changes RGB color order to BGR for input image [message #22571 is a reply to message #22569] Tue, 14 November 2000 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Craig Markwardt (craigmnet@cow.physics.wisc.edu) writes:

> The disappointment is that this lame code comes from RSI.

Yikes! I'm going to go have another look at my lame code
right now. :-(

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: Write_bmp procedure changes RGB color order to BGR for input image [message #22573 is a reply to message #22569] Tue, 14 November 2000 00:00 Go to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
sandeep.dalal@philips.com (Sandeep Dalal) writes:
...
>
> To my surprise, I discovered that using the RGB keyword in the IDL
> procedure "write_bmp" actually changes the color order of the supplied
> input image from RGB to BGR color order. This is non-intuitive. I
> would have expected that the keyword was only to indicate that the
> array is being supplied in the standard RGB color order. When IDL
> writes the file with the RGB keyword set, it should swap the red and
> blue buffers of the original image being written to the BMP file, but
> not swap them in the original image.
>
> For e.g.
> IDL> img = read_image(some_true_color_image_file) ; in RGB color order
> IDL> tv, img, /true ; looks good
> IDL> write_bmp, filename.bmp, img, /rgb
> IDL> tv, img, /true ; no good (:-(!

This is a classic error in IDL programming: a procedure modifying
parameters that it shouldn't. A smart procedure takes great care not
to modify its arguments.

The disappointment is that this lame code comes from RSI.

By the way this doesn't appear in IDL 5.0 or 5.2, so it's a new
addition.

Craig

--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: SLOW finite() on PV-WAVE under NT--old?
Next Topic: IDL Programming Techniques, 1st edition on ebay

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

Current Time: Sat Oct 11 06:00:06 PDT 2025

Total time taken to generate the page: 0.96093 seconds