meta info
- Title: LazZiya.ImageResize
- Keywords: asp.net-core, image, resize, crop, scale, text watermark, animated, gif
- Description: Image resizing tool for .Net applications to resize images and add text/image watermark, Supports most common image types including animated gif.
- Author: Ziya Mollamahmut
- Date: 10-Feb-2021
- Image: https://github.com/LazZiya/Docs/raw/master/LazZiya.ImageResize/v4.0/images/lazziya-imageresize-logo.png
- Image-alt: LazZiya.ImageResize Logo
- Version: v4.0
Image resizing tool for .Net applications to resize images and add text/image watermark, Supports most common image types including animated images as gif.
- Install
- Basic Usage
- Image Resizing Methods
- Image Watermark
- Text Watermark
- Image Frame
- Image Mask
- Animated Images
- Animated Text Watermark
- Animated Image Watermark
- Conditional Methods
Install via nuget package manager:
Install-Package LazZiya.ImageResize
using System.Drawing;
using LazZiya.ImageResize;
using(var img = Image.FromFile("wwwroot/images/image-file.jpg"))
{
img.ScaleByWidth(600)
.AddTextWatermark("https://docs.ziyad.info")
.SaveAs("wwwroot/images/resized-image.jpg");
}
- Windows
- Linux
This package depends on System.Drawing.Common
which is a cross platform GDI+ graphic processing package, and in order for it to work on linux/ubuntu systems install below libraries:
sudo apt install libc6-dev
sudo apt install libgdiplus
Parts of the animated gif support depends on a customized version of the code provided by gOODiDEA.NET in CodeProject.com.