Re: write JPEG [message #23341] |
Tue, 16 January 2001 02:19 |
hahn
Messages: 108 Registered: November 1993
|
Senior Member |
|
|
davidf@dfanning.com (David Fanning) wrote:
> It should have read something like this:
>
> You can't specify the resolution when you write the file,
> but you can specify the resolution of the image by
> changing its size before you write to the file.
Hm, actually this may not help. All that write_jped does
is to encode the bitmap and write it into the file. A JFIF
file has a header that contains the size of the picture
when it will be printed by some other software.
If I cannot set the size of the encoded picture I will
need some more steps later to specify it. Even worse,
some software will resample the bitmap before printing
and I have either supply parameters for this step or
- worse - I can't control it.
For a test I did
write_jpeg, "c:\temp\look.jpg", Bytscl(Dist(100))
and got a tiny file. Opening it with PaintShop Pro it tells
me the file has 72 DPI and a size of 100/72 inches.
Unfortunately there are more bitmap formats supported
by IDL that do not allow to pass the picture size for
printing. However, write_bmp does: Keyword header_define
It would be a great improvement to add this feature to
the other write_<your flavour> procedures.
Norbert
|
|
|
Re: write JPEG [message #23362 is a reply to message #23341] |
Mon, 15 January 2001 07:31  |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
David Fanning (davidf@dfanning.com) writes:
> You can't specify the resolution when you write the file,
> but you can save the size of the image you write.
I don't know what the heck *this* means. After
a total collapse in the third set of my morning
tennis, I think I was still winded. :-(
It should have read something like this:
You can't specify the resolution when you write the file,
but you can specify the resolution of the image by
changing its size before you write to the file.
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|
Re: write JPEG [message #23365 is a reply to message #23362] |
Mon, 15 January 2001 07:10  |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Michael Prinzler (michael.prinzler@tu-cottbus.de) writes:
> How can I specify the resolution 72dpi (default) to 300 dpi while storing an
> image with write_jpeg?
You can't specify the resolution when you write the file,
but you can save the size of the image you write. You
don't say what kind of display you are using, so I'll
use as an example TVREAD from my web page, which doesn't
care.
http://www.dfanning.com/programs/tvread.pro
Read the image from the display window:
image = TVREAD()
I presume this is a 24-bit image (I.e., that you are using
a 24-bit graphics card), but if it is not, you have to make
it one, since this is what WRITE_JPEG expects. (If you need
help, there are articles on my web page that should you how
to do this. For example: http:/www.dfanning.com/tips/jpeg.html.)
So the factors we are looking for, assuming a pixel
interleaved image, are:
s = Size(image, /Dimensions)
newx = Round(300.0 * s[1] / 72)
newy = Round(300.0 * s[2] / 72)
So,
highResImage = Congrid(image, 3, newx, newy, /Interp)
And then write it:
Write_JPEG, 'myfile.jpg', highResImage, True=1
> and (if you are veeery kind) :
> what means "No application/appled is present for use with LIVE_EXPORT."?
> This error message appears, if I start this (test)-code :
> pro live
> device,retain=2,decomposed=0
> window,1, Title = 'test'
> a=dist(512)
> tv,a
> live_export,Filename='test'
> wdelete,1
> end
Don't know. I don't use the Live Tools. And I can't make
out from the program exactly what it is you are trying
to do. :-(
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|