📷 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.
 
 
Anton Firszov a8657d9bd1 cleanup 9 years ago
build fixed stylecop path 9 years ago
src cleanup 9 years ago
tests introduced DecodedBlockMemento 9 years ago
.editorconfig Added Argb IPackedPixel 9 years ago
.gitattributes First Commit 14 years ago
.gitignore Added check for when the unit tests failed. 9 years ago
.travis.yml Enable running tests for Travis CI builds 9 years ago
APACHE-2.0-LICENSE.txt Async optimisation complete. 13 years ago
CodeCoverage.runsettings Fixing indentation in runsettings. 9 years ago
ImageSharp.ruleset Upgrade StyleCop to the latest beta. 9 years ago
ImageSharp.sln project dependencies + started README.md 9 years ago
ImageSharp.sln.DotSettings minor JpegDecoderCore cleanup 9 years ago
ImageSharp.v2.ncrunchsolution drop PointF and use Vector2 instead 9 years ago
NuGet.config Attempt to get x-plat builds running 9 years ago
README.md Coverity doesn't support core yet [skip ci] 9 years ago
Rebracer.xml Use direct access to Color to get/set pixels. 10 years ago
Settings.StyleCop Rename Bootstrapper to Configuration 9 years ago
appveyor.yml drop gitversion 9 years ago
build.cmd Independently version multiple projects 9 years ago
contributing.md Update contribution guidelines [skip ci] 9 years ago
dotnet-latest.ps1 Trigger build 10 years ago
features.md Update Readme [skip ci] 9 years ago
global.json reverted global.json change 9 years ago

README.md

ImageSharp

ImageSharp is a new cross-platform 2D graphics API designed to allow the processing of images without the use of System.Drawing.

ImageSharp is still in early stages (alpha) but progress has been pretty quick. As such, please do not use on production environments until the library reaches release candidate status. Pre-release downloads are available from the MyGet package repository.

GitHub license GitHub issues GitHub stars GitHub forks ![Gitter](https://badges.gitter.im/Join Chat.svg) Twitter

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

Installation

At present the code is pre-release but when ready it will be available on Nuget.

Pre-release downloads

We already have a MyGet package repository - for bleeding-edge / development NuGet releases.

Packages

The ImageSharp library is made up of multiple packages, to make ImageSharp do anything useful you will want to make sure you include at least one format as a dependency otherwise you will not be able to save/load any images.

Packages include:

  • ImageSharp Contains the Image classes, Colors, Primitives, Bootstrapper, IImageFormat interface, and other core functionality.
  • ImageSharp.Formats.Jpeg The jpeg decoder/encoder (Auto registered)
  • ImageSharp.Formats.Png The png decoder/encoder (Auto registered)
  • ImageSharp.Formats.Gif The gif decoder/encoder (Auto registered)
  • ImageSharp.Formats.Bmp The bmp decoder/encoder (Auto registered)
  • ImageSharp.Processing Contains methods like Resize, Crop, Skew, Rotate - Anything that alters the dimensions of the image. Contains methods like Gaussian Blur, Pixelate, Edge Detection - Anything that maintains the original image dimensions.
  • ImageSharp.Drawing Brushes and various drawing algorithms.

Manual build

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

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

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

Features

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

API

Without the constraints 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. Images and processors are thread safe usable in parallel processing utilizing all the availables cores.

Many Image methods are also fluent.

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.

using (FileStream stream = File.OpenRead("foo.jpg"))
using (FileStream output = File.OpenWrite("bar.jpg"))
{
    Image image = new Image(stream);
    image.Resize(image.Width / 2, image.Height / 2)
         .Grayscale()
         .Save(output);
}

Individual processors can be initialised and apply processing against images. This allows nesting which brings the potential for powerful combinations of processing methods:

new BrightnessProcessor(50).Apply(sourceImage, sourceImage.Bounds);

Setting individual pixel values is perfomed as follows:

Image image = new Image(400, 400);
using (var pixels = image.Lock())
{
    pixels[200, 200] = Color.White;
}

For advanced usage the Image<TColor> and PixelAccessor<TColor> classes are 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.

How can you help?

Please... Spread the word, contribute algorithms, submit performance improvements, unit tests.

Performance is a biggie, if you know anything about the new vector types and can apply some fancy new stuff with that it would be awesome.

There's a lot of developers out there who could write this stuff a lot better and faster than I and I would love to see what we collectively can come up with so please, if you can help in any way it would be most welcome and benificial for all.

The ImageSharp Team

Grand High Eternal Dictator

Core Team