XImage.Raster
Features
Tech Specs
How-to C#
Pricing

C# Imaging Library
How to C#: Resample Image


Tutorial for How to Resample Image



How to resample image using C#?

  1. Download XImage.Raster C# imaging library
  2. Install C# library to resample image in .NET applications
  3. Step by Step Tutorial












Steps to Resample image



  • Load an image with RasterImage object.
  • Create an image processor with ImageProcess object.
  • Call the method ResampleImage of ImageProcess object to complete the task flopping image.
  • Save the resampled image to an image file on the disk.


Sample code to Resample Image



By using the XImage.Raster C# Image SDK, you can modify the image size and orientation by assigning it to the processor. Unlike the resize image, resample image will resize the image without color mixing, so it is much faster than resize.

When you resize an image bigger or smaller, you can't just add or remove pixels randomly. Resampling is the algorithm that calculates what color each new pixel should be.

C# Sample Code (resample image):

RasterImage img = new RasterImage("C://input//raster-arrow-down.png");
ImageProcess processor = new ImageProcess(img);
processor.ResampleImage(new Size(300, 300), true);
img.Save("C://output//raster-image-resample.png");


Compare the source image and image resampled

Source image Image resampled