.NET cross-platform library - API for Image Processing

Create, load, manipulate or convert images without requiring any image editor.

  Download Free Trial
Aspose.Imaging for .NET edit photo edit image

Aspose.Imaging for .NET

 
 

Aspose. Imaging for.NET is a library offering advanced image processing features. You could easily create, load, manipulate, convert, compress images or photos using this API. Also Aspose. Imaging library supports drawing and work with graphic primitives. Image export and conversion (including uniform multi-page image processing) is the one of API core features along with image transformations (resize, crop, flip&rotate, binarization, grayscale, adjust), advanced image manipulation features (filtering, dithering, masking, deskewing) and memory optimization strategies.

Aspose.Imaging for .NET is a flexible, stable and powerful API, capable of processing the most commonly used formats along with some special formats such as DjVu, DICOM, WebP & DNG. Moreover, it extends the native support for image formats & processing functions for .NET and .NET Core. Aspose.Imaging is cross-platform library, it is Windows and Linux compatible.

 

Advanced Image Processing API Features

 

 

Create, load & edit images

 

Convert images to a variety of formats 

 

Various image filters and effects (gaussian, blur, median, grayscale, binarization, dithering etc)

 

Crop, resize & rotate-flip

 

Image deskew

 

Support animated multi-frame images

 

Uniform image page (frame) processing

 

Draw images using Graphics (graphics path and different geometric shapes)

 

Image masking

 

Memory optimization strategies

 

Draw text while controlling the font aspects

 

Save SVG with fonts embedded or exported

Convert Image Formats

Along with the rich set of processing routines, API also provides an array of advanced algorithms that makes it an all-in-one solution for image conversion. These algorithms are encapsulated in specialized classes, that are simple to use and can export images to conventional raster formats along with PSD, WMF, EMF, DjVu, DICOM, DNG & WebP formats with reliability.

Using this library, format conversion is as simple as changing the file extension to the desired format.

Save image in different formats - C#

// load file to be converted
using (var img = Aspose.Imaging.Image.Load(dir + "template.jpg"))
{
    // save in different formats
    img.Save(dir + "output.webp", new Aspose.Imaging.ImageOptions.WebPOptions());
    img.Save(dir + "output.psd ", new Aspose.Imaging.ImageOptions.PsdOptions());
    img.Save(dir + "output.tiff", new Aspose.Imaging.ImageOptions.TiffOptions(TiffExpectedFormat.Default));
     
     // Save image to Pdf
     PdfOptions exportOptions = new PdfOptions();
     exportOptions.PdfDocumentInfo = new Aspose.Imaging.FileFormats.Pdf.PdfDocumentInfo();

     img.Save(dir + "output.pdf", exportOptions);
}

Dynamically Draw Images

Aspose.Imaging for .NET supports an advanced set of drawing features along with the core functionality. Developers can draw on image surface either by manipulating the pixel information or by using the advanced functionality like Graphics and Paths.

.NET image library enables you to easily draw lines, curves, rectangles & other geometric shapes, fill closed shapes with solid colors or gradients & textures, draw text with options for fine control over the font and draw images by loading existing image data.

Edit photos

Aspose.Imaging provides ability to load, edit, process and save photos. Using library you can easily edit loaded photos, apply filters, manipulate them using Graphics and Paths. Using Aspose.Imaging, you can easily filter photos.

Load, edit, filter and save photos - C#


// load file to be converted
using (var img = Aspose.Imaging.Image.Load("photo.dng"))
{
    //Apply grayscale filter to loaded image
    img.Grayscale();
    //Save image to Jpeg format
    img.Save(dir + "output.jpg", new Aspose.Imaging.ImageOptions.JpegOptions());
}

Compress images

Aspose.Imaging for .NET supports compressed vector images. They are vector images of the EMF, WMF, SVG formats compressed using a zip archiver. Their size averages from 30-70% of the original. This saves space on media and reduces file transfer time over the network.

Create image, manipulate and save it to disk

Using Aspose.Imaging for .NET you can easily create images with specified parameters, manipulate them and save.

Create png image, manipulate it and save - C#


// Image width and height
int width = 500;
int height = 300;

// Where created image to store
string path = @"C:/createdImage.png";
// Create options
PngOptions options = new PngOptions() { Source = new FileCreateSource(path, false) };
using (PngImage image = (PngImage)Image.Create(options, width, height))
{          
     // Create and initialize an instance of Graphics class 
     // and Clear Graphics surface
     Graphics graphic = new Graphics(image);
     graphic.Clear(Color.Green);
     // Draw line on image
     graphic.DrawLine(new Pen(Color.Blue), 9, 9, 90, 90);        

     // Resize image
     int newWidth = 400;
     image.ResizeWidthProportionally(newWidth, ResizeType.LanczosResample);  

     // Crop the image to specified area
    Aspose.Imaging.Rectangle area = new Aspose.Imaging.Rectangle(10,10,200,200);    
    image.Crop(area);
   
    image.Save();
}
 

Support and Learning Resources

 

Aspose.Imaging offers individual Imaging APIs for other popular development environments as listed below: