I decided to add ToGeometry to the Density class. Below are some examples of how you could use this.
Density density = new Density(300, DensityUnit.PixelsPerCentimeter); MagickGeometry geometry = density.ToGeometry(1.13, 1.5); /* First option: image has the same aspect ratio */using (MagickImage image = new MagickImage("logo:")) { image.Density = density; image.Resize(geometry); image.Write("resize.png"); } /* Second option: crop the image */using (MagickImage image = new MagickImage("logo:")) { image.Density = density; image.Crop(geometry, Gravity.Center); image.Write("crop.png"); } /* Third option: extend the image */using (MagickImage image = new MagickImage("logo:")) { image.Density = density; image.Resize(geometry); image.Extent(geometry, Gravity.Center, MagickColors.Fuchsia); image.Write("extent.png"); }