📷 A modern, cross-platform, 2D Graphics library for .NET
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
James Jackson-South 0688343241 Final refactorings + bug fixes 8 years ago
.github Fixed links and added files to the solution. 9 years ago
.vscode inital rename packages and namespaces 9 years ago
build/icons inital rename packages and namespaces 9 years ago
input Wyam documentation 9 years ago
samples Formats per type namespaces 9 years ago
src Final refactorings + bug fixes 8 years ago
tests Final refactorings + bug fixes 8 years ago
.editorconfig generate pixel blenders 9 years ago
.gitattributes First Commit 14 years ago
.gitignore Remove unused files 8 years ago
.gitmodules I hope re-adding submodule after remove+commit+push+clean clone will work 9 years ago
.travis.yml Fix travis 8 years ago
CodeCoverage.runsettings Fixing indentation in runsettings. 9 years ago
ImageSharp.ruleset fix some tests and updated packages 9 years ago
ImageSharp.sln Merge branch 'master' into beta-1 9 years ago
ImageSharp.sln.DotSettings Update intellisens docs + copyright 8 years ago
LICENSE Create LICENSE 8 years ago
NuGet.config Fix nuget.config, Thanks VSCode!! 8 years ago
README.md Improve language in help 8 years ago
appveyor.yml build version in artefact path 8 years ago
build.cmd update version number generation system to remove gitversion 8 years ago
build.ps1 fix pr build number 8 years ago
codecov.yml DebugGuard 9 years ago
features.md Update readme and features 9 years ago
stylecop.json add missing stylecop.json 9 years ago

README.md

ImageSharp
ImageSharp

GitHub license Gitter Twitter OpenCollective OpenCollective

Without the use of System.Drawing we have been able to develop something much more flexible, easier to code against, and much, much less prone to memory leaks. Gone are system-wide process-locks; ImageSharp images are thread-safe and fully supported in web environments.

Built against .Net Standard 1.1 ImageSharp can be used in device, cloud, and embedded/IoT scenarios.

Questions?

Do you have questions? We are happy to help! Please join our gitter channel, or ask them on stackoverflow using the ImageSharp tag.

Installation

Package Name Release (NuGet) Nightly (MyGet)
SixLabors.ImageSharp NuGet MyGet
SixLabors.ImageSharp.Drawing NuGet MyGet

Packages

The ImageSharp library is made up of multiple packages:

  • SixLabors.ImageSharp

    • Contains the generic Image<TPixel> class, PixelFormats, Primitives, Configuration, and other core functionality.
    • The IImageFormat interface, Jpeg, Png, Bmp, and Gif formats.
    • Transform methods like Resize, Crop, Skew, Rotate - Anything that alters the dimensions of the image.
    • Non-transform methods like Gaussian Blur, Pixelate, Edge Detection - Anything that maintains the original image dimensions.
  • SixLabors.ImageSharp.Drawing

    • Brushes and various drawing algorithms, including drawing images.
    • Various vector drawing methods for drawing paths, polygons etc.
    • Text drawing.

Build Status

Build Status Code Coverage
Linux/Mac Build Status Code coverage
Windows Build Status Code coverage

Features

There's plenty there and more coming. Check out the current features!

API

Here's an example of the code required to resize an image using the default Bicubic resampler then turn the colors into their grayscale equivalent using the BT709 standard matrix.

On platforms supporting netstandard 1.3+

// Image.Load(string path) is a shortcut for our default type. Other pixel formats use Image.Load<TPixel>(string path))
using (Image<Rgba32> image = Image.Load("foo.jpg"))
{
    image.Mutate(x => x
         .Resize(image.Width / 2, image.Height / 2)
         .Grayscale());
    image.Save("bar.jpg"); // automatic encoder selected based on extension.
}

on netstandard 1.1 - 1.2

// Image.Load(Stream stream) is a shortcut for our default type. Other pixel formats use Image.Load<TPixel>(Stream stream))
using (FileStream stream = File.OpenRead("foo.jpg"))
using (FileStream output = File.OpenWrite("bar.jpg"))
using (Image<Rgba32> image = Image.Load<Rgba32>(stream))
{
    image.Mutate(x => x
         .Resize(image.Width / 2, image.Height / 2)
         .Grayscale());
    image.Save(output);
}

Setting individual pixel values can be perfomed as follows:

// Individual pixels
using (Image<Rgba32> image = new Image<Rgba32>(400, 400))
{
    image[200, 200] = Rgba32.White;
}

Rgba32 is our default PixelFormat, equivalent to System.Drawing Color. For advanced pixel format usage there are multiple PixelFormat implementations available allowing developers to implement their own color models in the same manner as Microsoft XNA Game Studio and MonoGame.

All in all this should allow image processing to be much more accessible to developers which has always been my goal from the start.

Check out this blog post or our Samples Repository for more examples!

Manual build

If you prefer, you can compile ImageSharp yourself (please do and help!), you'll need:

Alternatively on Linux you can use:

To clone it locally click the "Clone in Windows" button above or run the following git commands.

git clone https://github.com/SixLabors/ImageSharp

How can you help?

Please... Spread the word, contribute algorithms, submit performance improvements, unit tests, no input is too little.

The ImageSharp Team

Grand High Eternal Dictator

Core Team

Backers

Support us with a monthly donation and help us continue our activities. [Become a backer]

Sponsors

Become a sponsor and get your logo on our README on Github with a link to your site. [Become a sponsor]