On Jan 28, 2007, at 9:54 PM, Peter K. Stys wrote:
Frequently in scientific imaging you need to draw a red, grn and/or
blu image on top of a grayscale image to emulate a 4th "color"
channel.
Building an RGB pic from raw pixel values is easy but what is the
correct math to "add" a grayscale channel to an RGB image? Simply
adding the RGB components of the grayscale image (which are all equal
by definition) to the exisiting R, G and B values of the color image
does not give nice results.
Anyone have any ideas?
I use something like the following.
dim grey as Byte = (11*R + 59*G + 30*B)\100
If the RGB data is stored in a MemoryBlock, then building a greyscale
buffer can be implemented with decent speed.
Charles Yeomans
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>