display many color images [message #7924] |
Fri, 24 January 1997 00:00  |
dwu
Messages: 14 Registered: November 1995
|
Junior Member |
|
|
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.
Ding Wu
|
|
|
Re: display many color images [message #8035 is a reply to message #7924] |
Thu, 30 January 1997 00:00  |
sterner
Messages: 106 Registered: February 1991
|
Senior Member |
|
|
dwu@larry.cc.emory.edu (Ding Wu) 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.
Split each image into its RGB components, concatenate them as desired
into merged RGB components, and put them back together in 8 bits using
color_quan.
For example, two images IMG1 and IMG2 with color tables R1,G1,B1 and
R2, G2, B2 may be split into their RGB components:
RR1=R1(IMG1) & GG1=G1(IMG1) & BB1=B1(IMG1)
RR2=R2(IMG2) & GG2=G2(IMG2) & BB2=B2(IMG2)
(The color tables are obtained when you read the image or if it's
on the screen use tvlct,R1,G1,B1,/get).
Put these components together somehow. If they are the same size
one way is to put them side by side:
RR=[RR1,RR2] & GG=[GG1,GG2] & BB=[BB1,BB2]
Now convert back to 8 bits:
C = color_quan(RR,GG,BB,R,G,B)
To display:
tv,C
tvlct,R,G,B
color_quan does have it's limitations. You can play around with
several keywords but sometimes it just doesn't give good results.
Another trick is to save the new RGB components as the RGB parts
of a JPEG image and then read it back. I have found this to work
better in most cases. It would be nice to have a more direct access
to the JPEG color algorithm, maybe as an option to color_quan.
You might not expect this to work too well but I have found that it
actually does a pretty good job, surprised me when I first tried it.
Ray Sterner sterner@tesla.jhuapl.edu
The Johns Hopkins University North latitude 39.16 degrees.
Applied Physics Laboratory West longitude 76.90 degrees.
Laurel, MD 20723-6099
WWW Home page: http://fermi.jhuapl.edu/s1r/people/res/res.html
|
|
|