[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: write JPEG



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