Hey all I have the following C# code:
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");
}
}
This produces an image like this:
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.
And this is the overall look i am going for:
UPDATE
This is as far as i have gotten with translating the command line:
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");
lFiles.Add(@"C:\Users\David\Pictures\4.jpg");
lFiles.Add(@"C:\Users\David\Pictures\5.jpg");
using (MagickImageCollection images = new MagickImageCollection())
{
MagickImage magickinput = null;
foreach (string tempFile in lFiles)
{
magickinput = new MagickImage(tempFile);
IMagickImage _circle = new MagickImage();
magickinput.Resize(100, 100);
_circle = new MagickImage(MagickColor.FromRgb(255, 255, 255), magickinput.Width + 20, magickinput.Height);
_circle.Draw(new DrawableCircle(50, 50, 50, 100));
_circle.Alpha(AlphaOption.Off);
//_circle.Compose....????
}
}
I'm not sure how to do these following commands in C#:
xc:black
copy_opacity -layers
dstover -layers
xc:"graya(100%,0)"
+smush
UPDATE 2