With this version the API will change dramatically. Without the constraints of `System.Drawing` I have been able to develop something much more flexible, easier to code against, and much, much less prone to memory leaks. Gone are using image classes which implements `IDisposable`, Gone are system wide proces locks with Images and processors thread safe usable in parallel processing utilizing all the availables cores.
With this version the API will change dramatically. Without the constraints of `System.Drawing` I 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 proces locks with Images and processors thread safe usable in parallel processing utilizing all the availables cores.
Image methods are also fluent which allow chaining much like the `ImageFactory` class in the Framework version.
Image methods are also fluent which allow chaining much like the `ImageFactory` class in the Framework version.
@ -161,23 +161,20 @@ Here's an example of the code required to resize an image using the default Bicu
```csharp
```csharp
using (FileStream stream = File.OpenRead("foo.jpg"))
using (FileStream stream = File.OpenRead("foo.jpg"))
{
using (Image image = new Image(stream))
Image image = new Image(stream);
using (FileStream output = File.OpenWrite("bar.jpg"))
using (FileStream output = File.OpenWrite("bar.jpg"))
{
{
image.Resize(image.Width / 2, image.Height / 2)
image.Resize(image.Width / 2, image.Height / 2)
.Greyscale()
.Greyscale()
.Save(output);
.Save(output);
}
}
}
```
```
It will also be possible to pass collections of processors as params to manipulate images. For example here I am applying a Gaussian blur with a sigma of 5 to an image, then detecting the edges using a Sobel operator working in greyscale mode.
It will also be possible to pass collections of processors as params to manipulate images. For example here I am applying a Gaussian blur with a sigma of 5 to an image, then detecting the edges using a Sobel operator working in greyscale mode.
```csharp
```csharp
using (FileStream stream = File.OpenRead("foo.jpg"))
using (FileStream stream = File.OpenRead("foo.jpg"))
{
using (Image image = new Image(stream))
Image image = new Image(stream);
using (FileStream output = File.OpenWrite("bar.jpg"))
using (FileStream output = File.OpenWrite("bar.jpg"))
{
{
List<IImageProcessor> processors = new List<IImageProcessor>()
List<IImageProcessor> processors = new List<IImageProcessor>()
@ -189,7 +186,6 @@ using (FileStream stream = File.OpenRead("foo.jpg"))
image.Process(processors.ToArray())
image.Process(processors.ToArray())
.Save(output);
.Save(output);
}
}
}
```
```
Individual processors can be initialised and apply processing against images. This allows nesting which will allow the powerful combination of processing methods:
Individual processors can be initialised and apply processing against images. This allows nesting which will allow the powerful combination of processing methods:
thrownewImageProcessingException($"An error occured when processing the image using {this.GetType().Name}. See the inner exception for more detail.",ex);
thrownewImageProcessingException($"An error occured when processing the image using {this.GetType().Name}. See the inner exception for more detail.",ex);