Resize, keepiing resolution

Discussions about image processing and document imaging.
Post Reply
Chess
Posts: 22
Joined: Mon Apr 23, 2012 6:02 pm

Resize, keepiing resolution

Post by Chess » Mon Oct 31, 2016 1:44 am

Hi,

I have some image bigger than A4 (ISO format 8.27 × 11.7 inches) in 300 DPI. I want to reisze it to A4 format and set it to their original resolution (300 DPI).
Scale, resize, resizeWidthRatio always change the horizontal (and/or) vertical resolution, but no "real" image width or height

Is there a way to do it with Gd ?

Thanks,

Cedric
Posts: 269
Joined: Sun Sep 02, 2012 7:30 pm

Re: Resize, keepiing resolution

Post by Cedric » Thu Nov 03, 2016 4:04 pm

I'm not sure to understand what you mean, "real" image width or height is based on the actual width or height in pixels together with the resolution.
For instance an A4 format image is 8.27 × 11.7 inches so at 300 DPI the image will have a size of 2481 × 3510 pixels, it always follow this equation:

Code: Select all

pixels = inches × resolution
So altering the width or height of the image will obviously result in altering the other factors as well.
That being said, there is nothing that prevents you from manually setting the resolution to 300 DPI after the resize operation by calling SetHorizontalResolution and SetVerticalResolution methods.

Chess
Posts: 22
Joined: Mon Apr 23, 2012 6:02 pm

Re: Resize, keepiing resolution

Post by Chess » Fri Dec 23, 2016 11:32 pm

Thanks for answer and I did exactly what you said (setting manually horizontal / vertical DPI) after resize.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests