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

Home » Public Forums » archive » Change the default dpi
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
Change the default dpi [message #44101] Fri, 20 May 2005 14:55 Go to next message
envi35@yahoo.ca is currently offline  envi35@yahoo.ca
Messages: 48
Registered: March 2005
Member
Does any one how to change the default dpi setting in ENVI? I want to
export some JPEG images with 300 dpi, instead of the the default 72
dpi. Is this possible in ENVI?

I'm sorry to post this ENVI-related question here, but I can't find any
ENVI user group. And I suppose most of you are ENVI experts as well:)

Thank you in advance,
Jenny
Re: Change the default dpi [message #44157 is a reply to message #44101] Tue, 24 May 2005 08:34 Go to previous message
James Kuyper is currently offline  James Kuyper
Messages: 425
Registered: March 2000
Senior Member
envi35@yahoo.ca wrote:
> But it seems that I can't do this in ENVI. Say my image is 512*512, I
> can only export it as a 512*512 image, I can't change the dimentions.

We have ENVI 4.1 installed; what I'm about to say may be different in
different versions of ENVI.

Select "Basic Tools" from the top menu. On the drop-down menu, select
"Resize Data (Spatial/Spectral)". Select your input file, and then hit
the "OK" button. Set the Samples/Lines numbers to match your desired
output size. Save the result in memory - if you tell it to save to a
file it will save it in an ENVI-specific format. Choose your desired
sampling method, and whether or not you want the file compressed. Hit
the "OK" button and it rebins the data in memory.

Select "File" from the top menu. On the drop-down menu, select "Save
File As". Choose JPEG2000 (old-style jpeg doesn't seem to be an
available option), and a dialog window pops up. Select the "Input File"
that corresponds to your resized image in memory. Hit the "OK" button,
and a new dialog window replaces the old one. Choose your desired
output file name and compression level. Hit the "OK" button, and you're
done.

If JPEG2000 isn't acceptable, then you have to use IDL directly, rather
than ENVI:

READ_JPEG,infilename,image
output = REBIN(image,3,newcols,newrows)
WRITE_JPEG,outfilename,output,/true

REBIN requires that each new dimension be a multiple or factor of the
corresponding dimension of the original image. If that's an
unacceptable limitation, then you can use CONGRID instead, though it's
somewhat slower.
Re: Change the default dpi [message #44170 is a reply to message #44101] Mon, 23 May 2005 21:17 Go to previous message
envi35@yahoo.ca is currently offline  envi35@yahoo.ca
Messages: 48
Registered: March 2005
Member
But it seems that I can't do this in ENVI. Say my image is 512*512, I
can only export it as a 512*512 image, I can't change the dimentions.
I know a little bit IDL (direct graphics), so I'm thinking maybe I
could try to do a program. Is it possible to use different colors or
color tables to display different parts of an image? My image includes
3 parts: ocean (=999), land(=900), ROIs on land (=0~100). I'd like my
ocean to be white, land to be yellow, and ROIs to be displayed using
the Blue-red color table. I've been trying for 3 hours with no luck.
Could you give me some hints or at least tell me is it possible with
IDL direct graphics?

Thanks again,
Jenny
Re: Change the default dpi [message #44171 is a reply to message #44101] Mon, 23 May 2005 15:27 Go to previous message
Rick Towler is currently offline  Rick Towler
Messages: 821
Registered: August 1998
Senior Member
> Thanks, Rick. Paint Shop could be used to check the dpi of any image.
> The problem is the images I'm preparing will be published in a journal,
> and it has strick length limit, so your suggestion to export a larger
> image won't work in my case.

Sure it will.

O.K. I was wrong about the JPEG header business (I just played around
with photoshop and JPEGs can store dpi info), but you still can export
to a larger size then load it into Paint Shop and "fix" it.

Say you want a 2" x 2" image @ 300dpi. Export a 600 x 600 image from
ENVI. Load it into your paint program and change the DPI to 300 while
at the same time changing the print size to 2" x 2" (this preserves the
pixel dimensions so no resampling occurs). Save it.

Now you have a 2" x 2" JPEG image at 300dpi.

-Rick
Re: Change the default dpi [message #44173 is a reply to message #44101] Mon, 23 May 2005 14:06 Go to previous message
envi35@yahoo.ca is currently offline  envi35@yahoo.ca
Messages: 48
Registered: March 2005
Member
Thanks, Rick. Paint Shop could be used to check the dpi of any image.
The problem is the images I'm preparing will be published in a journal,
and it has strick length limit, so your suggestion to export a larger
image won't work in my case.
Thank you all the same.

-Jenny
Re: Change the default dpi [message #44177 is a reply to message #44101] Mon, 23 May 2005 10:37 Go to previous message
Rick Towler is currently offline  Rick Towler
Messages: 821
Registered: August 1998
Senior Member
envi35@yahoo.ca wrote:
> Does any one how to change the default dpi setting in ENVI? I want to
> export some JPEG images with 300 dpi, instead of the the default 72
> dpi. Is this possible in ENVI?

I don't know anything about ENVI, and I don't know a lot about the JPEG
spec, but in my experience JPEG images don't store dpi info in their
header (or at least I haven't used a program that reads it).

So if you want a final image with a greater dpi just export a larger
image. For a 2" x 2" 300dpi print image, export a 600 pixel x 600 pixel
image from ENVI.


-Rick
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Axis text of 3-d object surface is disappearing!
Next Topic: Re: How to dispaly one image with different color tables?

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

Current Time: Wed Oct 08 15:16:19 PDT 2025

Total time taken to generate the page: 0.00710 seconds