1. Products
  2.   Image
  3.   .NET
  4.   ImageResizer
 
  

Open Source .NET API for Images

Reseize Images Online using Free .NET API.

ImageResizer is an open source .NET API for resizing JPEG, PNG, GIF, BMP, WMF,and EMF file formats. This free image processing API is developed & optimized for server-side use. Using the API, you can resize your image, rotate an image, flip image, crop the image, use padding autocripping, carving & stretching, and apply borders, margins, & background colors. Furthermore, the API offers+ plugins to enhance the Image Processing capabilities.

After implementing your resizing operations the API outputs images in JPG, PNG, and GIF file formats with JPEG compression between 0-100 and colors between 2-255.

Previous Next

Getting Started with ImageResizer

The recommended way to install ImageResizer is via NuGet. Please use the following command to install ImageResizer.

Install ImageResizer via NuGet

Install-Package ImageResizer

Resize Image via Free .NET API

ImageResizer API allows sizing images by setting padding, autocropping, carving, and stretching. The developers can easily fit the image within the specified bounds using maxWidth and maxHeight properties, preserving aspect ratio and width and height properties are used to enforce the final width & height

Upload Convert & Resize Images via .NET


    //Loop through each uploaded file
    foreach (string fileKey in HttpContext.Current.Request.Files.Keys) 
    {
        HttpPostedFile file = HttpContext.Current.Request.Files[fileKey];
        if (file.ContentLength <= 0) continue; //Skip unused file controls.
        
        //The resizing settings can specify any of 30 commands.. See http://imageresizing.net for details.
        //Destination paths can have variables like  and , or 
        //even a santizied version of the original filename, like 
        ImageResizer.ImageJob i = new ImageResizer.ImageJob(file, "~/uploads/.", new ImageResizer.ResizeSettings( 
                    "width=2000;height=2000;format=jpg;mode=max"));
        i.CreateParentDirectory = true; //Auto-create the uploads directory.
        i.Build();
    }

Rotate and Flip Images using Free .NET API

The Open Source image library ImageResizer automatically rotates the images based on the EXIF information and by setting autorotate to true. Furthermore, you can rotate your image to a specific angle by using rotate = degrees option. Similarly you can flip your image using flip=none|x|y|xy properties.

Apply Borders & Margins in Images using C#

ImageResizer library allows developers to apply borders, margins, padding, and background colors. You can set image border width & color properties by using borderWidth and borderColor properties. Similarly, you can apply universal margin or left, right, top & bottom margin using the API.

 English