To accomplish this, we've extracted the code for all of Pinta's effects into a graphics toolkit agnostic library called Pinta.ImageManipulation and posted it up on NuGet for easy use. This includes over 35 multi-threaded effects exposed as cancelable Tasks.
The core of Pinta.ImageManipulation is graphics toolkit agnostic and only works on arrays of BGRA bytes, but we've also included wrappers for System.Drawing (GDI+) and Cairo (GTK+).
Now that you've got all those great new holiday photos, let's see how to apply an effect to them in 5 lines of code.
Create a new project, bring up the NuGet dialog, and search for Pinta:
Select the Pinta.ImageManipulation.System.Drawing package and install it...
..which adds 2 new project references, the toolkit agnostic core and the System.Drawing wrapper.
Now we need to:
- Load an image into System.Drawing.Bitmap
- Wrap it into a BitmapWrapper we can pass to Pinta.
- Create a new emboss effect.
- Render the emboss effect to the image.
- Save the result.
var photo = new Bitmap (@"C:\helo.png");Resulting in:
var photo_wrapper = new BitmapWrapper (photo);
var blur = new EmbossEffect ();
await blur.RenderAsync (photo_wrapper);
A full list of available effects can be found here.
Pinta.ImageManipulation retains Paint.NET and Pinta's MIT X11 license, so feel free to use this in your applications.
If you want to submit new effects, send us a pull request on GitHub: