DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: change image dimensions  (Read 4,595 times)

kalos

  • Member
  • Joined in 2006
  • **
  • Posts: 1,824
change image dimensions
« on: December 03, 2011, 10:22 PM »
hello

I have a rectangular imagewith specific ratio, dpi, x dimension and y dimension

I want to preserve its dpi and ratio, but give its y dimension another value (which will alter x dimension proportionally, ofcourse)

how can I do this?

thanks!

ewemoa

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 2,922
    • Plugin Coding Medal
    • Participated in NANY Challenge Three Times
Re: change image dimensions
« Reply #1 on: December 04, 2011, 07:17 AM »
I'm not sure about preserving DPI, but if it's scaling while preserving aspect ratio, one thing I might use is the GIMP's scale image feature:

  http://www.simplehelp.net/2007/08/13/how-to-resize-images-using-the-gimp/

JavaJones

  • Review 2.0 Designer
  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 2,739
    • Participated in NANY Challenge Once
Re: change image dimensions
« Reply #2 on: December 05, 2011, 06:03 AM »
This is a very common and simple image manipulation problem solved by most image editors, as far as I'm aware. So the better question is do you need to automate it, do it programatically, or batch-process, or something else complicated? Otherwise many applications should do what you want with a simple Resize function. For example XnView handles this easily. Just open the resize dialog, make sure it's set to preserve aspect ratio and *not* preserve print size (which would change DPI as you changed resolution), and then enter your new Y value, the X will adjust automatically. Note also that XnView has a batch processing function and I think there is even a commandline version and/or a library that you could access in code to do things programatically.

- Oshyan

cmpm

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 2,026
Re: change image dimensions
« Reply #3 on: December 05, 2011, 02:27 PM »
This one may be too simple, but it does have custom settings.
And claims to keep 'a proper aspect ratio'.
From their site.
Quote
FreeSizer will always use a proper aspect ratio, these values are not absolute. FreeSizer will automatically calculate the proper aspect ratio and use the values that are nearest to your desired image size.
http://freesizer.com/help/index.html?AdvancedResizingTechniques.html
http://www.freesizer.com/

Original address: https://www.donationcoder.com/forum/index.php?topic=29041.0