Code: Select all
List<string> lFiles = new List<string>();
lFiles.Add(@"C:\Users\David\Pictures\1.jpg");
lFiles.Add(@"C:\Users\David\Pictures\2.jpg");
lFiles.Add(@"C:\Users\David\Pictures\3.jpg");
IFiles.Add(@"C:\Users\David\Pictures\4.jpg");
IFiles.Add(@"C:\Users\David\Pictures\5.jpg");
using (MagickImageCollection images = new MagickImageCollection())
{
MagickImage magickinput = null;
foreach (string tempFile in lFiles)
{
magickinput = new MagickImage(tempFile);
magickinput.Alpha(AlphaOption.Set);
magickinput.Quality = 100;
magickinput.Resize(0, 100);
magickinput.Distort(DistortMethod.DePolar, 0);
magickinput.VirtualPixelMethod = VirtualPixelMethod.HorizontalTile;
magickinput.BackgroundColor = MagickColors.None;
magickinput.Distort(DistortMethod.Polar, 0);
images.Add(magickinput);
}
var montageSettings = new MontageSettings()
{
BackgroundColor = MagickColors.None,
TileGeometry = new MagickGeometry(lFiles.Count, 1),
Shadow = true,
Geometry = new MagickGeometry(-10, 5, 0, 0)
};
using (IMagickImage result = images.Montage(montageSettings))
{
result.Composite(magickinput, CompositeOperator.DstIn);
result.Trim();
result.RePage();
result.Write(@"C:\Users\David\Pictures\combinedImgs.png");
}
}
Notice that the area around Maggie (the first image) has Lisa (the second image) within it and cuts out some of image 2???. It also cuts off Marge (last image). If I just set Geometry = new MagickGeometry(-10, 5, 0, 0) to Geometry = new MagickGeometry(5, 5, 0, 0) it then looks like this:
Which fixes Marge (last image) but Maggie (first image) still looks odd...
I've also noticed that all the images seem to be "fuzzy" with their outlines:
First image is the original and the second is the Magick version.
Images used:
Maggie (first image) by herself looks like this:
What am I doing incorrectly? I'm using version ImageMagick-7.0.7-Q16.