Select language
  1. Products
  2. Aspose.Imaging
  3. Image album
clearbit icon

Create image album for .NET

Convenient tools to create image album from several images or photos, aka multi-frame or muti-page image. Such composition is supported for wide range of input image formats and several popular output mulit page formats aka pdf, tiff, dicom.

Share
Instagram Logo Dribbble Logo Twitter Logo Youtube Logo

How to Create Image Album Using .NET Library

In order to create image album from the several Image files, we’ll use Aspose.Imaging for .NET API which is a feature-rich, powerful and easy to use image manipulation API for net platform. Open NuGet package manager, search for Aspose.Imaging and install. You may also use the following command from the Package Manager Console.

1
Install-Package Aspose.Imaging

Create Image Album via .NET

You need Aspose.Imaging for .NET and Aspose.Imaging.Image.Album.NET license to try the code in your environment.

  1. Load input Images to collect the reference data.
  2. Create output image album from the array of input images and save it in the desired format
  3. You may also create the specific multi-page image (tiff or dicom) and add the input images one by one
  4. You may pre-resize input images to fit the same or required page or frame size.

System Requirements

Just make sure that you have the following prerequisites.

  • Microsoft Windows or a compatible OS with .NET Core
  • Development environment like Visual Studio Code or Microsoft Visual Studio.
  • Aspose.Imaging for .NET DLL referenced in your project.
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
using System;
 using Aspose.Imaging;
 using Aspose.Imaging.FileFormats.Pdf;

namespace CSharpTutorials
{
    class Program
    {
        static void Main(string[] args)
        {
            if(args.Lenght<3)
            {
                Console.WriteLine("Please specify inpur folder with images to merge and ");
                Console.WriteLine("wildcard mask of the input images (i.e. *.png or *.jpg) and");
                Console.WriteLine("output folder to create image album");
                return;
            }

            // Valid image album plug-in license use example
            License license=new License();
            license.SetLicense("Aspose.Imaging.Image.Album.NET.lic");

            string OutputDirectory = Path.Combine(TestDirectory, "ImageAlbum");
            if (!Directory.Exists(OutputDirectory))
            {
                Directory.CreateDirectory(OutputDirectory);
            }

            var images = new List<Image>();

            foreach (var fileName in Directory.GetFiles(TestDirectory, "*.png"))
            {
                var image = Image.Load(fileName);

                images.Add(image);
            }

            try
            {
                var outputPath = Path.Combine(OutputDirectory, "image_album.pdf");
                MakeAlbum(images, new PdfOptions(), outputPath);
            }
            finally
            {
                images.ForEach(image => image.Dispose());
            }
        }            

        void MakeAlbum(List<Image> images, ImageOptionsBase imageOptions, string outputPath)
        {
            using (var image = Image.Create(images.ToArray()))
            {
                image.Save(outputPath, imageOptions);
            }
        } 
    }
}

You may find other allowed image album creation cases and examples here