SciSharp / NumSharp

High Performance Computation for N-D Tensors in .NET, similar API to NumPy.
https://github.com/SciSharp
Apache License 2.0
1.38k stars 192 forks source link

Built-in System.Drawing.Image and Bitmap methods #343

Open Nucs opened 5 years ago

Nucs commented 5 years ago

Theres a repeating need for methods to load Image to bitmap, we should provide performant builtin API for that.

EDIT 1: System.Drawing.Bitmap are now supported by a separate package, read more.

Oceania2018 commented 5 years ago

Yes, many people need it. It helps. But that will make NumSharp introduce extra dependency. Or we just add file.read to bytes interface ?

Nucs commented 5 years ago

Yes, System.Drawing.Image package. I'm thinking about new NDArray(System.Drawing.Image) and np.array(System.Drawing.Image) or something of that sort.

sdg002 commented 5 years ago

Thanks for all the hard work. My 2 cents. It might be worth considering the pros and cons of keeping System.Drawing.Image outside of the core NDArray through a factory approach. At some later date you might consider introducing a factory class for images loaded using ImageSharp or some other imaging library.

This approach will not cut down your code, however it might spare end developers from having to add too many NUGET references. Gives them the opportunity to progressively encompass more packages as the needs grow. E.g. In my company, System.Drawing is not really favored because it does not work on Azure functions due to GDI+ restrictions of Azure function sandbox.

Nucs commented 5 years ago

@sdg002 Thanks for the note, I've decided to create separate projects and nuget packages for NumSharp.Bitmap (published) and NumSharp.ImageSharp (WIP).

Oceania2018 commented 5 years ago

Is it possible to integrate OpenCvSharp into NumSharp.ImageSharp?