From 03d30cf9ca37e3445d990cd95b8e63cfb9411874 Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Mon, 9 Nov 2015 00:36:22 +1100 Subject: [PATCH] Update README.md Former-commit-id: 385b17100f3ecdce2454412b0863feaa682606eb Former-commit-id: 7f68a2867369da1fad3cb9d7eb566d25d199c190 Former-commit-id: a15e9fb7c68ac16260c0f0dc92879bd40749d15c --- README.md | 79 ++++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 66 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 0b5ff1d26..63f4f74d2 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # ImageProcessor -**This branch contains the highly experimental cross platform version of ImageProcessor**. +**This branch contains the new cross platform version of ImageProcessor**. -This is a complete rewrite from the ground up to allow the processing of images without the use of `System.Drawing` using a portable class library (PCL). +This is a complete rewrite from the ground up to allow the processing of images without the use of `System.Drawing` using a portable class library (PCL). It's still in early stages but progress has been pretty quick. ###Why am I writing this? @@ -10,7 +10,7 @@ With NETCore there is currently no version of `System.Drawing` to allow continue ###Is this wise? -Honestly... I don't know. I could be writing code that may be suddenly obsolete. There has been little [feedback](https://github.com/dotnet/corefxlab/issues/86#issuecomment-139930600) on questions I've asked but it's a nice learning process if anything. +Honestly... I don't know. I could be writing code that may be suddenly obsolete. There has been little [feedback](https://github.com/dotnet/corefxlab/issues/86#issuecomment-139930600) on questions I've asked but it's a nice learning process if anything and I will definitely be releasing the code for consumption. ###What works so far/ What is planned? @@ -19,10 +19,11 @@ Honestly... I don't know. I could be writing code that may be suddenly obsolete. - [x] bmp (More bmp format saving support required, 24bit just now) - [x] png (Need updating for saving indexed support) - [x] gif -- Basic color structs with implicit operators. Vector backed. +- Basic color structs with implicit operators. Vector backed. Need help investigating premultiplication. - [x] Color - Float based, No limit to r, g, b, a values allowing for a fuller color range. - [x] BGRA32 - [ ] CIE Lab + - [ ] CIE XYZ - [x] CMYK - [x] HSV - [ ] HSLA @@ -52,8 +53,8 @@ Honestly... I don't know. I could be writing code that may be suddenly obsolete. - [ ] Elliptical Crop - [ ] Entropy Crop - Rotation - - [ ] Flip (90, 270, FlipType etc) - - [ ] Rotate by angle + - [ ] Flip (90, 270, FlipType etc. Need help) + - [ ] Rotate by angle (Need help) - ColorMatrix operations (Uses Matrix4x4) - [x] BlackWhite - [x] Greyscale BT709 @@ -84,17 +85,69 @@ Honestly... I don't know. I could be writing code that may be suddenly obsolete. - [x] Saturation - [ ] Hue - [x] Blend + - [ ] Mask - Effects - - [ ] Pattern brushes - - [ ] Elliptical brushes - - [ ] Gradient brush (vignette?) - + - [ ] Pattern brushes (Need help) + - [ ] Elliptical brushes (Need help) + - [ ] Gradient brush (vignette? Need help) +- Other stuff I haven't thought of. ###What might never happen -- Font support (Depends on new System.Text stuff) +- Exif manipulation - There's a lot of quirks in parsing EXIF and I'd need a ton of help to get it all coded. +- Font support (Depends on new System.Text stuff) I don't know where to start coding this so if you have any pointers please chip in. + +###API Changes + +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. + +Image methods are also fluent which allow chaining much like the `ImageFactory` class in V2 and below. + +Here's an example of the code required to resize an image using the default Robidoux resampler then turn the colors into their greyscale equivalent using the BT709 standard matrix. + +```csharp +using (FileStream stream = File.OpenRead("foo.jpg")) +{ + Image image = new Image(stream); + using (FileStream output = File.OpenWrite("bar.jpg")) + { + image.Resize(image.Width / 2, image.Height / 2) + .Greyscale() + .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. + +```csharp +using (FileStream stream = File.OpenRead("foo.jpg")) +{ + Image image = new Image(stream); + using (FileStream output = File.OpenWrite("bar.jpg")) + { + List processors = new List() + { + new GuassianBlur(5), + new Sobel { Greyscale = true } + }; + + image.Process(processors.ToArray()) + .Save(output); + } +} +``` +Individual processors can be initialised and apply processing against images. This allows nesting which will allow the powerful combination of processng methods: + +```csharp +new Brightness(50).Apply(sourceImage, targetImage, sourceImage.Bounds); +``` + +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? -Spread the word, contribute algorithms, performance improvements, unit tests. Help me setup the solution properly for NETCore etc (I dunno if I have my setup correct) +Please... Spread the word, contribute algorithms, submit performance improvements, unit tests. Help me set up CI for nightly releases. + +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 people can come up with. +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.