Page 1 of 1

Image proportion Retention Help

Posted: 07.08.2007, 03:40
by Ozark
Does anyone out there Know of maybe a bash script or an exe program to resize an image while retaining image proportions?

For example I'm coming across a lot of files that are saved in different sizes such as 43201x15601 but when converting them to say, 32768x16384 the image proportions turn out more squared, and don't line up properly with my other maps.

Posted: 07.08.2007, 09:58
by Spaceman Spiff
Hmm, you're trying to resize one of them thar Nightttime Lights Time Series images at your recommended http://www.ngdc.noaa.gov/dmsp/global_composites_v2.html, aren't you?

I note 43201 ?— 15601 isn't 2:1, and that must be because those images only cover ?±65?° in latitude: (15601-1)/(43201-1)?—180?° = 65?°. It should be 43201 ?— 21601.

I also wonder if the fact that the horizontal dimension is 43201, not 43200 means that the first and last column is a repeat of the ?±180?° meridian?

I suggest you resize the original image to 43200 ?— 15600 first, then resize the canvas to 43200 ?— 21600, leaving the original image centred, and filling new canvas with black, or alternatively those older, lower resolution light maps with aurorae.

Finally, resize to powers of 2, of course!

Spiff.

Re: Image proportion Retention Help

Posted: 07.08.2007, 10:05
by RVS
Ozark wrote:Does anyone out there Know of maybe a bash script or an exe program to resize an image while retaining image proportions?


IrfanView (http://www.irfanview.com/) can do it for you.

Posted: 07.08.2007, 21:32
by Ozark
Thanks for the tip Spaceman Spiff, I'll give it a try. BTW you are quite right about the night lights! :wink:

Posted: 11.08.2007, 15:17
by Ozark
8) Thanks again Spaceman Spiff. A very clever fix. Here are a couple before and after shots.

BadNight:

Image

Goodnight:

Image

Ozark