Re: Creating JPEG files [message #32423] |
Wed, 09 October 2002 09:30 |
Med Bennett
Messages: 109 Registered: April 1997
|
Senior Member |
|
|
Med Bennett wrote:
> Mike Jewison wrote:
>
>> I have a short program which generates a 2D plot using a standard call
>> to the PLOT procedure, displaying to the X-windows device. I would
>> like to also have this plot dumped to a JPEG file for display on a web
>> page. Although the plot looks just fine on the screen, when I issue
>> the following command:
>>
>> WRITE_JPEG, JPEG_File, TVRD()
>>
>> the resultant JPEG file has very little contrast (i.e. it's basically
>> near-black on black). I know the WRITE_JPEG procedure is better
>> suited to images rather than plots, but is there (a) a better way to
>> create a JPEG file of a plot rather than what I'm doing, or (b)
>> another file format which IDL supports that would do a good job of
>> creating a web-compatible image format? I used to use the WRITE_GIF
>> format until IDL dropped support for it.
>>
>> Many thanks.
>>
>> - Mike
>
> JPEG is really better suited for continuous tone graphics, i.e. photos,
> shaded surface plots, etc. If you're trying to capture line art, ie. a
> plot with only a few distinct colors, I believe it would be better to use
> a GIF or PNG file format. The lossy JPEG compression does ugly things to
> line graphics, and actually can create larger files than one of the
> lossless graphics formats.
Sorry, I didn't read your whole post before making my response. I believe
PNG is what you should try.
|
|
|
Re: Creating JPEG files [message #32424 is a reply to message #32423] |
Wed, 09 October 2002 09:26  |
Med Bennett
Messages: 109 Registered: April 1997
|
Senior Member |
|
|
Mike Jewison wrote:
> I have a short program which generates a 2D plot using a standard call
> to the PLOT procedure, displaying to the X-windows device. I would
> like to also have this plot dumped to a JPEG file for display on a web
> page. Although the plot looks just fine on the screen, when I issue
> the following command:
>
> WRITE_JPEG, JPEG_File, TVRD()
>
> the resultant JPEG file has very little contrast (i.e. it's basically
> near-black on black). I know the WRITE_JPEG procedure is better
> suited to images rather than plots, but is there (a) a better way to
> create a JPEG file of a plot rather than what I'm doing, or (b)
> another file format which IDL supports that would do a good job of
> creating a web-compatible image format? I used to use the WRITE_GIF
> format until IDL dropped support for it.
>
> Many thanks.
>
> - Mike
JPEG is really better suited for continuous tone graphics, i.e. photos,
shaded surface plots, etc. If you're trying to capture line art, ie. a
plot with only a few distinct colors, I believe it would be better to use
a GIF or PNG file format. The lossy JPEG compression does ugly things to
line graphics, and actually can create larger files than one of the
lossless graphics formats.
|
|
|
Re: Creating JPEG files [message #32425 is a reply to message #32424] |
Wed, 09 October 2002 08:30  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
David Fanning (david@dfanning.com) writes:
> You can learn all the gory details here:
>
> http://www.dfanning.com/tips/jpeg.html
Humm, actually, you *can't* read all the gory details
there, as I just discovered by reading the darn article. :-(
Well, you *should* be able to read all the gory details.
I'm going off to have a word with the webmaster now. I
can assure you there will be the proper file there shortly!!
In the meantime, I *know* the gory details are in the TVREAD
code. That would be a good place to find them.
Embarrassed,
David
--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|
|
Re: Creating JPEG files [message #32427 is a reply to message #32426] |
Wed, 09 October 2002 08:09  |
R.Bauer
Messages: 1424 Registered: November 1998
|
Senior Member |
|
|
Mike Jewison wrote:
> I have a short program which generates a 2D plot using a standard call
> to the PLOT procedure, displaying to the X-windows device. I would
> like to also have this plot dumped to a JPEG file for display on a web
> page. Although the plot looks just fine on the screen, when I issue
> the following command:
>
> WRITE_JPEG, JPEG_File, TVRD()
>
> the resultant JPEG file has very little contrast (i.e. it's basically
> near-black on black). I know the WRITE_JPEG procedure is better
> suited to images rather than plots, but is there (a) a better way to
> create a JPEG file of a plot rather than what I'm doing, or (b)
> another file format which IDL supports that would do a good job of
> creating a web-compatible image format? I used to use the WRITE_GIF
> format until IDL dropped support for it.
>
> Many thanks.
>
> - Mike
Dear Mike,
WRITE_JPEG, JPEG_File, TVRD(/true) ,/true
should be used if you are using a true color graphics device.
regards
Reimar
--
Reimar Bauer
Institut fuer Stratosphaerische Chemie (ICG-I)
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
------------------------------------------------------------ -------
a IDL library at ForschungsZentrum Juelich
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_lib_intro. html
============================================================ =======
|
|
|
Re: Creating JPEG files [message #32428 is a reply to message #32427] |
Wed, 09 October 2002 08:12  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Mike Jewison (m_jewison@hotmail.com) writes:
> I have a short program which generates a 2D plot using a standard call
> to the PLOT procedure, displaying to the X-windows device. I would
> like to also have this plot dumped to a JPEG file for display on a web
> page. Although the plot looks just fine on the screen, when I issue
> the following command:
>
> WRITE_JPEG, JPEG_File, TVRD()
>
> the resultant JPEG file has very little contrast (i.e. it's basically
> near-black on black). I know the WRITE_JPEG procedure is better
> suited to images rather than plots, but is there (a) a better way to
> create a JPEG file of a plot rather than what I'm doing, or (b)
> another file format which IDL supports that would do a good job of
> creating a web-compatible image format? I used to use the WRITE_GIF
> format until IDL dropped support for it.
Try TVREAD:
http://www.dfanning.com/programs/tvread.pro
You would use it like this:
IDL I = TVREAD(/JPEG)
The results are guaranteed to be perfect. :-)
Cheers,
David
--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|