NumSharp icon indicating copy to clipboard operation
NumSharp copied to clipboard

Built-in System.Drawing.Image and Bitmap methods

Open Nucs opened this issue 6 years ago • 5 comments

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.

Nucs avatar Sep 01 '19 13:09 Nucs

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

Oceania2018 avatar Sep 01 '19 13:09 Oceania2018

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.

Nucs avatar Sep 01 '19 13:09 Nucs

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.

sdg002 avatar Sep 10 '19 09:09 sdg002

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

Nucs avatar Sep 11 '19 20:09 Nucs

Is it possible to integrate OpenCvSharp into NumSharp.ImageSharp?

Oceania2018 avatar Oct 04 '19 11:10 Oceania2018