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

Home » Public Forums » archive » Re: What don't I know about jpeg, 3 channels, and color display?
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: What don't I know about jpeg, 3 channels, and color display? [message #41058] Thu, 23 September 2004 09:28
dow is currently offline  dow
Messages: 5
Registered: August 2004
Junior Member
Dave,

Thanks for the info. I'm not too concerned about the "science" part
because I'm using this program for resizing digital camera images of
my 1 year old son :-)
The images from the camera are too high resolution to email and post
on a web page, but I got sick of loading them into commercial software
and resaving them at lower res. So I'm now using IDL to read them (as
a batch) in at 1600x1200 and rewriting them at half that size. But the
concept of color still puzzles me.
I would never do "science" on a jpeg.....

Dorthe

David Fanning <david@dfanning.com> wrote in message news:<MPG.1bbc2a579d8cc502989684@news.frii.com>...
> Dee writes:
>
>> thanks, it worked once I also used the true=1 with read_jpeg. I still
>> can't use my routines (which assume a 2D array) for displaying etc.
>> but I got around that by using other functions. I still don't
>> understand the 3D issue with these jpegs though..... :-)
>
> You are using the wrong routines. :-)
>
> You need to get ahold of TVImage, or ImgDisp,
> or PlotImage. One of the image display routines
> smart enough to figure out if you have a 2D or
> 3D image and do the right thing. You can find
> TVImage here:
>
> http://www.dfanning.com/programs/tvimage.pro
>
> You can, of course, convert a 3D image to a 2D
> image, but if you want to maintain a reasonable
> representation of the colors in the 24-bit image,
> then you have to be very careful about resizing the
> image, etc., because the resulting color table
> from Color_Quan will not be anything at all like
> what you are used to. For example, to convert a
> pixel-interleaved 24-big JPEG image:
>
> image2d = Color_Quan(image24, 1, r, g, b)
> TVLCT, r, g, b
> TV, image2d
>
> Or, you can make a gray-scale image out of the
> 24 bit image:
>
> http://www.dfanning.com/ip_tips/color2gray.html
>
> You have to be a little bit careful, however, about
> using old procedures on JPEG images. A JPEG image
> typically only has *color* information, it only
> rarely, and then in special conditions, has science
> information.
>
> Cheers,
>
> David
Re: What don't I know about jpeg, 3 channels, and color display? [message #41064 is a reply to message #41058] Thu, 23 September 2004 00:34 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Dee writes:

> thanks, it worked once I also used the true=1 with read_jpeg. I still
> can't use my routines (which assume a 2D array) for displaying etc.
> but I got around that by using other functions. I still don't
> understand the 3D issue with these jpegs though..... :-)

You are using the wrong routines. :-)

You need to get ahold of TVImage, or ImgDisp,
or PlotImage. One of the image display routines
smart enough to figure out if you have a 2D or
3D image and do the right thing. You can find
TVImage here:

http://www.dfanning.com/programs/tvimage.pro

You can, of course, convert a 3D image to a 2D
image, but if you want to maintain a reasonable
representation of the colors in the 24-bit image,
then you have to be very careful about resizing the
image, etc., because the resulting color table
from Color_Quan will not be anything at all like
what you are used to. For example, to convert a
pixel-interleaved 24-big JPEG image:

image2d = Color_Quan(image24, 1, r, g, b)
TVLCT, r, g, b
TV, image2d

Or, you can make a gray-scale image out of the
24 bit image:

http://www.dfanning.com/ip_tips/color2gray.html

You have to be a little bit careful, however, about
using old procedures on JPEG images. A JPEG image
typically only has *color* information, it only
rarely, and then in special conditions, has science
information.

Cheers,

David
--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http:/www.dfanning.com/
Phone: 970-221-0438, IDL Book Orders: 1-888-461-0155
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Colored image
Next Topic: 3rd Party Active-X

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

Current Time: Wed Oct 08 16:00:29 PDT 2025

Total time taken to generate the page: 0.00603 seconds