Hi there,
I hope someone can help me.
I am using the Magick++ API and want to resize a 1920x1080 image to 720x480. I can do this with the command line no problem, but can't find a way to achieve this with Magick++. My images keep coming out as 720 x 405.
I have tried :
Geometry newSize = Geometry(720, 480);
background.resize(newSize);
Geometry newSize = Geometry(720, 480);
background.zoom(newSize);
Thanks for your time,
Jim
Magick++ Resize Image
Re: Magick++ Resize Image
The image aspect ratio is respected by default for image geometries. You can override this behavior, like this:
- Geometry newSize = Geometry("720x480!");
Re: Magick++ Resize Image
Thanks,
It's so obvious, now. Your help is much appreciated.
All the best,
Jim
It's so obvious, now. Your help is much appreciated.
All the best,
Jim
Re: Magick++ Resize Image
I found the following works as well:
Hope this helps someone else.
Code: Select all
Geometry newSize = Geometry(720, 480);
// Resize without preserving Aspect Ratio
newSize.aspect(true);
background.resize(newSize);