Re: Color separation with IDL [message #9505] |
Thu, 10 July 1997 00:00 |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Miska Le Louarn writes:
> I would like to print an image to a slide. To do that, I need a color
> separated version of this image, i.e. three images, each containing the
> Red, Green or Blue component of the image to be printed.
>
> Then I could save these 3 images into a single TIFF file, using the
> planarconfig keyword, and send the image to the printing company...
>
> So would any of you know how to do this color separation ? I would
> *think* it should be fairly simple to do, but I don't know how to get
> started !
This color separation technique is explained more completely in
a tip entitled "How do I create a color JPEG file from a 2D image?"
on my web page, but this is how I would do it:
; Get some image data.
image = DIST(300)
; Load a color table and get the RGB color vectors
; in the Z-graphics buffer.
thisDevice = !D.Name
Set_Plot, 'Z'
LoadCT, 5 ; Standard Gamma II
TVLCT, r, g, b, /Get
Set_Plot, thisDevice
; Create the color separations by running the image
; through the color vectors. (Image is scaled into
; range of 0-255.)
redImage = r(image)
greenImage = g(image)
blueImage = b(image)
; Create the TIFF file. Note that you *may* want
; to make a 24-bit TIFF image, in which case
; you just combine these three separate images
; into a 3D array.
Write_Tiff, 'thisTiffFile.tif', PlanarConfig=2, $
Red=redImage, Green=greenImage, Blue=blueImage
Cheers,
David
------------------------------------------------------------ ---
David Fanning, Ph.D.
Fanning Software Consulting
Customizable IDL Programming Courses
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com
IDL 5 Reports: http://www.dfanning.com/documents/anomaly5.html
|
|
|