Comments (1)
Howdy! Thanks for the kind words!
It's always nice to encounter someone with an interest in imaging algorithms and performance. I've set up a gitter channel and just haven't added it to the readme yet. Feel free to hop on there if you want to discuss possible work in that area.
As far as I understand, you are using an AoS algorithm, working directly on the 4, 3 or 1 channel color structs, duplicating the kernel weights to that dimension
That's correct, mostly. The majority use case for resizing in MagicScaler is JPEG in planar Y'CbCr format, so most of the work it does (in pure numbers of pixels processed) is SoA layout. It may be possible to get some further gains by using SoA on BGR and BGRA data, however I have attempted to keep the algorithms working mostly the same between .NET Core and .NET Framework targets, and since there are no shuffle operations available on Framework, it's not practical to implement SoA. And I'm actually quite pleased with the performance I've achieved using AoS with duplicated kernel weights. The kernel weights are re-used, keeping them in CPU cache, so there probably isn't much to be gained once you factor in the cost of reorganizing the data before and after convolution.
Furthermore, I think bandwidth could be decreased by working on 16-bit floats as input, but at first sight .NET SIMD doesn't support that yet. Maybe 16-bit integers would also work...
16-bit floats are a no-go for now, but you'll see I've implemented the pure scalar convolution in 16-bit integer for .NET Framework 32-bit targets, where legacy JIT doesn't support SIMD in any fashion and where floating-point math uses slow x87 instructions. The same algorithms could be expanded to true SIMD, but again this would lead to less sharing between .NET Core and .NET Framework targets where SIMD is supported. It's on my list for future exploration.
Other thinks I would like to experiment with are streaming writes, more cache friendly image transposition, …
Again, please stop by the gitter channel if you'd like to chat about any possible improvements or are interested in contributing. I'm always on the lookout for ideas :)
from photosauce.
Related Issues (20)
- Problem with certain PNG images HOT 8
- Transparent Color on PadTransform HOT 1
- RobiniaDocs API Explorer
- Update libwebp HOT 4
- Option to retain gif loop count when resizing HOT 6
- Could not load type 'PhotoSauce.MagicScaler.Converters.ChannelChanger`1' HOT 8
- ColorMatrixTransform does not unpremultiply/premultiply HOT 1
- Default JPEG encoding options are not publicly accessible HOT 4
- EncoderInfo not set correctly if output to Stream
- MagicScalar Linux issue
- libpng throws bad adaptive filter will abort writing result HOT 3
- libpng fails to convert several files that WIC can handle HOT 2
- `ArgumentOutOfRangeException` reading JPEG XL image from their test page HOT 3
- After update the solution to .NET 8 version the NativeCodecs dependency started to fail HOT 3
- Noob question: Having a hard time understanding the native codec binary build steps.
- How to gain best possible quality, disregard performance.
- IMultiFrameDecoderOptions support missing for JPEG XL HOT 1
- Decoder FrameRange validation is not valid HOT 2
- Build warning with net8.0 app HOT 2
- Native png encoder not working in 14.1 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from photosauce.