I'm using Magick.NET to generate some images for a splash screen for Android and iOS(https://cordova.apache.org/docs/en/late ... ard-images).
But I'm having some issues with the resize.
We can have a square or rectangle image and portrait or landscape but when I convert it stretches:

Post your original image to some free hosting service and put the URL here. Also post your code.

You may be specifying in your code to resize to an exact fit. If the resize arguments are not square, then your square image will be resized and distorted. You want to resize and preserve aspect ratio. I do not use Magick.NET but you can see the command line flags for resizing at https://imagemagick.org/script/command- ... p#geometry

Hi and thank you for your answer.
Do you have a sample of this working using Magick.NET?
It's the first time I'm dealing with this API to work with images and I'm not getting there.
Really appreciate your help.
Cheers

But in command line, you have two choices if you do not want to distort your image and the aspect ratios of the input and desired size are not the same: 1) resize to the larger dimension and pad or 2) resize to the smaller dimension and crop. With the former you would need to specify a desired background color to fill the pad area

This second approach ignores the rectangular form of my inputted width x height. For instance, using 1280x1920 I'm getting an image with 1280x1280.

Both approaches will create the exact size you specify in the resize. Is that not what you want. If you specify 1280x1920 both approaches will make an image of 1280x1920 no matter what the input dimensions are. Is that not what you want?

If not that, then what do you expect for the output size?

You only have two other choices: 1) preserver the aspect ratio of the input 2) force the output to that specified size without cropping and without padding and have the image be distorted.

Both approaches will create the exact size you specify in the resize. Is that not what you want. If you specify 1280x1920 both approaches will make an image of 1280x1920 no matter what the input dimensions are. Is that not what you want?

If not that, then what do you expect for the output size?

Hello fmw42.
Yes that is the size I want.
The thing is that my output is coming with 1280x1280.
I might be missing something on that approach.
Here's my code:

You are on Windows. The syntax is slightly different. The ^ symbol is an escape and so needs to be doubled. In ImageMagick 7, use magick, not magick convert. So your command should be the following if you want your output to be exactly 1280x1920.

Ok, so that was the issue, great!
Now I just need to understand how can I map it to Magick.NET. What's the meaning of that symbol "^" and in the crop what means the "+0+0 " after the Crop operation? Maybe by knowing the meaning it is easier.