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

Home » Public Forums » archive » Re: display many color images
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: display many color images [message #7911] Sun, 26 January 1997 00:00
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Ding Wu <dwu@larry.cc.emory.edu> writes:

> Anyone knows how to display many color images simultaneously.
>
> Splitting the color table will badly damage the color, and almost
> impossible for many, say 20, images.
>
> I am thinking writing something using fixed the color table, using 256
> colors to approximate all the colors, then images pixels looking for its
> most close representations in the color table. It defenitely changes the
> colors of the image, just fools human's eyes.

I gave Ding a rather flippant suggestion about purchasing a 24-bit
graphic card in an earlier post, but Paul Sorenson sent me a
suggestion that had never occurred to me. (This is something
Paul has a knack for doing!) He suggested this might be accomplished
by using the COLOR_QUAN procedure with the CUBE keyword set.

Since I didn't even know the COLOR_QUAN procedure *had* a CUBE
keyword, I read up on it. This is a really good suggestion! But,
unfortunately, in the little example program I wrote below, I
am not too keen on the result. I think the problem is that the
COLOR_QUAN procedure cannot dither the resulting images
when it calculates the image values from the color cube. This
results in images that look "spotty" to me.

But I thought others might be interested in this novel approach.
I did the color table loading in the Z-buffer to take advantage of
its 256 colors

Thanks again to Paul.

David

***********************************
PRO EXAMPLE
image = BYTSCL(DIST(256), TOP=255)
thisDevice = !D.NAME
SET_PLOT, 'Z'

; Gray-scale Colors

LOADCT, 0
TVLCT, r, g, b, /GET
image1 = COLOR_QUAN(r(image), g(image), b(image), r, g, b, CUBE=6)

; Standard Gamma II Colors

LOADCT, 5
TVLCT, r, g, b, /GET
image2 = COLOR_QUAN(r(image), g(image), b(image), r, g, b, CUBE=6)

; Blue-Red Colors

LOADCT, 11
TVLCT, r, g, b, /GET
image3 = COLOR_QUAN(r(image), g(image), b(image), r, g, b, CUBE=6)

SET_PLOT, thisDevice

; Load the COLOR_QUAN colors.

TVLCT, r, g, b

WINDOW, 1, XSize=256, YSize=256
TV, BYTSCL(image1, TOP=215)

WINDOW, 2, XSize=256, YSize=256
TV, BYTSCL(image2, TOP=215)

WINDOW, 3, XSize=256, YSize=256
TV, BYTSCL(image3, TOP=215)

END
********************************************

-----------------------------------------------------------
David Fanning, Ph.D.
Fanning Software Consulting
2642 Bradbury Court, Fort Collins, CO 80521
Phone: 970-221-0438 Fax: 970-221-4762
E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com
-----------------------------------------------------------
Re: display many color images [message #7914 is a reply to message #7911] Sun, 26 January 1997 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Ding Wu <dwu@larry.cc.emory.edu> writes:

> Anyone knows how to display many color images simultaneously.
>
> Splitting the color table will badly damage the color, and almost
> impossible for many, say 20, images.
>
> I am thinking writing something using fixed the color table, using 256
> colors to approximate all the colors, then images pixels looking for its
> most close representations in the color table. It defenitely changes the
> colors of the image, just fools human's eyes.
>
> Better idea, or any written codes, please.

I think purchasing a 24-bit video card would be a LOT less work! :-)

David

-----------------------------------------------------------
David Fanning, Ph.D.
Fanning Software Consulting
2642 Bradbury Court, Fort Collins, CO 80521
Phone: 970-221-0438 Fax: 970-221-4762
E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com
-----------------------------------------------------------
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: idl for liunx
Next Topic: Re: Interrupting widget applications

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

Current Time: Wed Oct 08 20:01:38 PDT 2025

Total time taken to generate the page: 0.00657 seconds