ImageProcessor
:camera: A fluent wrapper around System.Drawing for the processing of image files.
Top Related Projects
:camera: A modern, cross-platform, 2D Graphics library for .NET
High-performance image manipulation for web servers. Includes imageflow_server, imageflow_tool, and libimageflow
SkiaSharp is a cross-platform 2D graphics API for .NET platforms based on Google's Skia Graphics Library. It provides a comprehensive 2D API that can be used across mobile, server and desktop models to render images.
The .NET library for ImageMagick
ImageMagick is a free, open-source software suite for creating, editing, converting, and displaying images. It supports 200+ formats and offers powerful command-line tools and APIs for automation, scripting, and integration across platforms.
Skia is a complete 2D graphic library for drawing Text, Geometries, and Images.
Quick Overview
ImageProcessor is a lightweight, high-performance image processing library for .NET. It provides a fluent API for image manipulation tasks such as resizing, cropping, filtering, and format conversion. The library is designed to be fast, extensible, and easy to use in various .NET applications.
Pros
- High performance and efficient memory usage
- Extensive set of image processing operations
- Supports multiple image formats (including WebP and TIFF)
- Easy to use fluent API
Cons
- Limited documentation for advanced usage
- Some features may require additional NuGet packages
- Not as feature-rich as some commercial alternatives
- May have compatibility issues with older .NET Framework versions
Code Examples
Resizing an image:
using ImageProcessor;
using ImageProcessor.Imaging.Formats;
using (var imageFactory = new ImageFactory(preserveExifData: true))
{
imageFactory.Load("input.jpg")
.Resize(new Size(800, 600))
.Save("output.jpg");
}
Applying a filter and adjusting brightness:
using ImageProcessor;
using ImageProcessor.Imaging.Filters.Photo;
using (var imageFactory = new ImageFactory())
{
imageFactory.Load("input.jpg")
.Filter(MatrixFilters.BlackWhite)
.Brightness(20)
.Save("output.jpg");
}
Converting image format:
using ImageProcessor;
using ImageProcessor.Imaging.Formats;
using (var imageFactory = new ImageFactory())
{
imageFactory.Load("input.jpg")
.Format(new PngFormat())
.Save("output.png");
}
Getting Started
-
Install the NuGet package:
Install-Package ImageProcessor
-
Add the following using statements to your code:
using ImageProcessor; using ImageProcessor.Imaging.Formats;
-
Use the
ImageFactory
class to load, process, and save images:using (var imageFactory = new ImageFactory()) { imageFactory.Load("input.jpg") .Resize(new Size(800, 600)) .Save("output.jpg"); }
Competitor Comparisons
:camera: A modern, cross-platform, 2D Graphics library for .NET
Pros of ImageSharp
- Cross-platform support (Windows, macOS, Linux)
- Better performance, especially for larger images
- More active development and community support
Cons of ImageSharp
- Smaller feature set compared to ImageProcessor
- Steeper learning curve for developers familiar with System.Drawing
Code Comparison
ImageSharp:
using SixLabors.ImageSharp;
using SixLabors.ImageSharp.Processing;
using (Image image = Image.Load("input.jpg"))
{
image.Mutate(x => x.Resize(800, 600));
image.Save("output.jpg");
}
ImageProcessor:
using ImageProcessor;
using ImageProcessor.Imaging.Formats;
using (var imageFactory = new ImageFactory(preserveExifData: true))
{
imageFactory.Load("input.jpg")
.Resize(new Size(800, 600))
.Save("output.jpg");
}
Both libraries offer similar functionality for basic image processing tasks. ImageSharp's API is more modern and uses a fluent interface with the Mutate
method, while ImageProcessor uses a more traditional approach with method chaining.
ImageSharp is generally recommended for new projects due to its cross-platform support and active development. However, ImageProcessor may still be preferred in some scenarios, especially when working with legacy codebases or when specific features are required that are not yet available in ImageSharp.
High-performance image manipulation for web servers. Includes imageflow_server, imageflow_tool, and libimageflow
Pros of Imageflow
- Written in Rust, offering better performance and memory safety
- Supports a wider range of image formats, including WebP and AVIF
- Provides a REST API for easy integration with various platforms
Cons of Imageflow
- Less mature project with potentially fewer community contributions
- May have a steeper learning curve for developers not familiar with Rust
- Limited documentation compared to ImageProcessor
Code Comparison
ImageProcessor (C#):
using (Image image = Image.Load("input.jpg"))
{
image.Mutate(x => x
.Resize(new ResizeOptions { Size = new Size(800, 600), Mode = ResizeMode.Max })
.Grayscale());
image.Save("output.jpg");
}
Imageflow (Rust):
let mut c = Context::create()?;
c.configure_operation(Operation::Decode)?
.configure_operation(Operation::Constrain(800, 600))?
.configure_operation(Operation::EncodeToBytes(ImageFormat::Jpeg))?
.execute()?;
Both libraries offer image processing capabilities, but Imageflow's Rust implementation may provide better performance for certain operations. ImageProcessor, being more established, might have a larger ecosystem and more extensive documentation. The choice between the two depends on specific project requirements, performance needs, and developer familiarity with the respective languages and ecosystems.
SkiaSharp is a cross-platform 2D graphics API for .NET platforms based on Google's Skia Graphics Library. It provides a comprehensive 2D API that can be used across mobile, server and desktop models to render images.
Pros of SkiaSharp
- Cross-platform support for multiple operating systems and devices
- Extensive graphics capabilities, including 2D and 3D rendering
- Backed by Google's Skia graphics engine, ensuring high performance and regular updates
Cons of SkiaSharp
- Steeper learning curve due to its comprehensive feature set
- Larger library size, which may impact application size
- May be overkill for simple image processing tasks
Code Comparison
ImageProcessor:
using (var image = new Image<Rgba32>(400, 400))
{
image.Mutate(x => x.Resize(200, 200));
image.Save("output.jpg");
}
SkiaSharp:
using (var surface = SKSurface.Create(new SKImageInfo(400, 400)))
{
var canvas = surface.Canvas;
canvas.Scale(0.5f);
using (var image = SKImage.FromEncodedData("input.jpg"))
{
canvas.DrawImage(image, 0, 0);
}
surface.Snapshot().Encode(SKEncodedImageFormat.Jpeg, 100).SaveTo(File.OpenWrite("output.jpg"));
}
The .NET library for ImageMagick
Pros of Magick.NET
- More comprehensive feature set, supporting a wider range of image formats and operations
- Better performance for complex image processing tasks
- Actively maintained with frequent updates and improvements
Cons of Magick.NET
- Larger library size and more dependencies
- Steeper learning curve due to its extensive API
- May be overkill for simple image processing tasks
Code Comparison
ImageProcessor:
using (var image = new ImageFactory())
{
image.Load(inputPath)
.Resize(new Size(150, 0))
.Save(outputPath);
}
Magick.NET:
using (var image = new MagickImage(inputPath))
{
image.Resize(150, 0);
image.Write(outputPath);
}
Both libraries offer straightforward APIs for basic image processing tasks. ImageProcessor uses a fluent interface, while Magick.NET uses a more traditional object-oriented approach. Magick.NET's API is more extensive, reflecting its broader feature set, but may require more setup for simple operations.
ImageMagick is a free, open-source software suite for creating, editing, converting, and displaying images. It supports 200+ formats and offers powerful command-line tools and APIs for automation, scripting, and integration across platforms.
Pros of ImageMagick
- Extensive feature set with support for over 200 image formats
- Robust command-line interface for batch processing
- Large community and extensive documentation
Cons of ImageMagick
- Steeper learning curve due to its complexity
- Larger footprint and potentially slower performance for simple tasks
- Requires external dependencies and installation
Code Comparison
ImageMagick (command-line):
convert input.jpg -resize 50% -quality 80 output.jpg
ImageProcessor:
using (var image = Image.Load("input.jpg"))
{
image.Mutate(x => x.Resize(image.Width / 2, image.Height / 2));
image.Save("output.jpg", new JpegEncoder { Quality = 80 });
}
ImageMagick offers a concise command-line approach, while ImageProcessor provides a more programmatic C# implementation. ImageMagick's syntax is simpler for quick tasks, but ImageProcessor offers more fine-grained control within a .NET environment.
ImageProcessor is generally easier to integrate into .NET projects and provides a more intuitive API for developers familiar with C#. However, ImageMagick's versatility and cross-platform support make it a powerful choice for complex image processing tasks across various environments.
Skia is a complete 2D graphic library for drawing Text, Geometries, and Images.
Pros of Skia
- More comprehensive graphics library with broader capabilities
- Highly optimized for performance across multiple platforms
- Extensive documentation and community support
Cons of Skia
- Steeper learning curve due to its complexity
- Larger codebase and potentially higher resource usage
- May be overkill for simple image processing tasks
Code Comparison
ImageProcessor (C#):
using (Image image = Image.Load("input.jpg"))
{
image.Mutate(x => x
.Resize(new ResizeOptions { Size = new Size(800, 600), Mode = ResizeMode.Max })
.Grayscale());
image.Save("output.jpg");
}
Skia (C++):
SkBitmap bitmap;
SkImageDecoder::DecodeFile("input.jpg", &bitmap);
SkBitmap resized;
SkImageResizer::Resize(bitmap, SkImageResizer::kLinear_ResizeMethod, 800, 600, &resized);
SkBitmap grayscale;
SkColorFilter::MakeColorMatrix(SkColorMatrix::MakeSaturation(0))->filterImage(resized, &grayscale);
SkImageEncoder::EncodeFile("output.jpg", grayscale, SkImageEncoder::kJPEG_Type, 100);
ImageProcessor is more straightforward for basic image processing tasks, while Skia offers more low-level control and advanced features for complex graphics operations.
Convert
designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
ImageProcessor
â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸
ImageProcessor is, and will only ever be supported on the .NET Framework running on a Windows OS. Please do not attempt to use with .NET Core or NET 5+
â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸â ï¸
Imageprocessor is a lightweight, fluent wrapper around System.Drawing.
It's fast, extensible, easy to use, comes bundled with some great features and is fully open source.
For full documentation please see https://jimbobsquarepants.github.io/ImageProcessor/
Roadmap
Focus for the ImageProcessor libraries has switched to desktop only due to the lack of support for System.Drawing on Windows Services and ASP.NET. As such, the ImageProcessor.Web
and accompanying libraries will not be further developed. For an alternative please use ImageSharp.Web
.
ImageProcessor has been retired. For modern platforms use ImageSharp
Latest Releases
Library | Version |
---|---|
ImageProcessor | |
ImageProcessor.Plugins.WebP |
Documentation
ImageProcessor's documentation, included in this repo in the gh-pages branch, is built with Jekyll and publicly hosted on GitHub Pages at For full documentation please see https://jimbobsquarepants.github.io/ImageProcessor/. The docs may also be run locally.
Running documentation locally
- If necessary, install Jekyll (requires v2.5.3x).
- Windows users: Read this unofficial guide to get Jekyll up and running without problems.
- From the root
/ImageProcessor
directory, runjekyll serve
in the command line. - Open http://localhost:4000 in your browser to navigate to your site. Learn more about using Jekyll by reading its documentation.
The ImageProcessor Team
Grand High Eternal Dictator
Top Related Projects
:camera: A modern, cross-platform, 2D Graphics library for .NET
High-performance image manipulation for web servers. Includes imageflow_server, imageflow_tool, and libimageflow
SkiaSharp is a cross-platform 2D graphics API for .NET platforms based on Google's Skia Graphics Library. It provides a comprehensive 2D API that can be used across mobile, server and desktop models to render images.
The .NET library for ImageMagick
ImageMagick is a free, open-source software suite for creating, editing, converting, and displaying images. It supports 200+ formats and offers powerful command-line tools and APIs for automation, scripting, and integration across platforms.
Skia is a complete 2D graphic library for drawing Text, Geometries, and Images.
Convert
designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot