cs-util-com / cscore

cscore is a minimal-footprint library providing commonly used helpers & patterns for your C# projects. It can be used in both pure C# and Unity projects.
https://cs-util-com.github.io/cscore/
Apache License 2.0
183 stars 31 forks source link

Improve Image processing helper methods #110

Closed cs-util closed 2 months ago

cs-util commented 11 months ago

There is already a branch ( https://github.com/cs-util-com/cscore/tree/update/StbImageSharp ) prepared to switch to the latest version of StbImageSharp ( https://github.com/StbSharp/StbImageSharp )

The main missing piece according to my notes is that the images are currently all vertically flipped since Conversion.stbi__vertical_flip(image.Data, image.Width, image.Height, 4); had to be removed. Maybe the latest StbImageSharp version has it included again, so take the 2 commits on that branch more as an inspiration than a mandatory path to take.

There are also alternatives like https://github.com/StbSharp/SafeStbImageSharp that should be tested if the work better, might be better to switch to this one to have full compatibility with Unity?

On top of that update a few more usage examples should be created in the form of further unit tests to do typical image operations around resizing, rotating, cropping, saving in different compressed formats, ..

Related branches with drafts of images algorithms to add: