feat: add lanczos interpolation implementation#734
Conversation
|
Nice! I'll take a look at this soon when I get a chance. |
|
I'll look into this at the next week, aglo probably needs more tweaking and that alpha issue |
fixes alpha issue, uses oklab linear color space for better preservation of details implemented via SIMD operations for a better performance
|
@brendan-duncan fixed alpha issue and made some performance adjustments, I'm very pleased with downscaling results as of now |
|
Awesome, I'll check it out soon. Thanks! |
|
I'm refactoring code right now, is resize.dart even used anywhere beside tests? Its part of src (internal files), but I cant see any references to resize function of itself. |
|
resize.dart was a request to be able to do in-place resizing of images, as apposed to copyResize which always makes a copy, and is an exported function. |
|
Thanks for reply, missed the export sorry. I've tried to iterate on algo to fix it for upscaling, but no luck. If you're good with this particular implementation of interpolation being good for downscaling but bad for upscaling I probably should update docs for it and add explicit note. I lack proper knowledge about image processing, so I think I leave this version for now, maybe in future when I'll have some more time I'll try to dig deeper about convolution filters and fix this implementation. Also some related links: |
|
I'm not forgetting about this, just been busy with the family |
|
No worries about that! I've also found some issues with downscaling very big images to a very small, such as 1024->64, alpha looks inverted for some reason. Can't give any dates, due to work, but I plan on changing this to a different approach - make a new file and implement convolution based scaling as in links I mentioned, so I think you can ignore pr this for a while. |


based on MIT licensed https://github.com/Megakuul/image_scaler/blob/main/lib/lanczos.dart
resize works good, but I'm not sure if that's correct implementation for
getPixelLanczosit produces good results for down sampling, but upscaling is not good comparing to resize (because of missing precise scale factor?)
i've compared it by using fall back (last else before) instead of dedicated switch case.