Aspose.Imaging Image Merger for .NET
The Aspose.Imaging Image Merger for .NET Plugin allows developers to combine multiple images into collages or composite layouts without quality loss. Supporting a wide range of raster formats, it enables horizontal, vertical, or custom merges while preserving resolution, color profiles, and metadata.
Installation
- Add the Aspose.Imaging for .NET NuGet package.
- Unlock full functionality with a Metered License .
Example: Merging Images
var images = new List<Image>();
string[] files = new string[] { "template.png", "template.jpg" };
foreach (var fileName in files)
{
images.Add(Image.Load(fileName));
}
MergeImages(images, 0); // Horizontal merge
MergeImages(images, 1); // Vertical merge
void MergeImages(List<Image> images, byte direction)
{
int width = direction == 0 ? images.Sum(img => img.Width) : images.Max(img => img.Width);
int height = direction == 1 ? images.Sum(img => img.Height) : images.Max(img => img.Height);
using (var merged = Image.Create(new PngOptions() { ColorType = PngColorType.TruecolorWithAlpha }, width, height))
{
var graphics = new Graphics(merged);
float x = 0, y = 0;
foreach (var img in images)
{
graphics.DrawImage(img, new RectangleF(x, y, img.Width, img.Height));
if (direction == 0) x += img.Width; else y += img.Height;
}
merged.Save("result_" + direction + ".png");
}
}
Key Features
Versatile Merge Layouts
- Merge images horizontally, vertically, or in tiled/custom arrangements.
- Control alignment, spacing, and padding between images.
Multi-Format Support
- Works with JPEG, PNG, BMP, TIFF, GIF, and other supported formats .
- Preserves original color profiles and metadata.
Quality Preservation
- Maintains resolution and pixel detail without recompression artifacts.
- Format-aware processing ensures consistent results.
Batch Processing
- Queue and process large sets of images in one run.
- Execute tasks sequentially or in parallel for maximum throughput.
Performance and Integration
- Optimized streaming APIs for low memory usage.
- Works in .NET Core, .NET 5+, and .NET Framework.
- Integrates with ASP.NET pipelines, desktop apps, or background services.
Free Online Image Merger
Try the Aspose.Imaging Free Online Image Merger to test functionality instantly without coding.
Tips and Best Practices
- Validate input dimensions to choose the best merge strategy.
- Dispose of images promptly to free resources.
- Use PNG for transparency or JPEG for photos depending on output needs.
- Enable streaming for very large images to manage memory efficiently.
- Apply custom padding and background fills for visually consistent collages.
Conclusion
The Aspose.Imaging Image Merger for .NET Plugin is the best choice for developers needing efficient, high-quality image merging. Whether creating photo collages, combining scanned documents, or generating custom layouts, it delivers professional results. Unlock full functionality for just $99 and enhance your .NET projects with advanced image merging.