Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork294
feat: add lanczos interpolation implementation#734
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
brendan-duncan commentedMay 4, 2025
Nice! I'll take a look at this soon when I get a chance. |
brendan-duncan commentedMay 7, 2025
Zekfad commentedMay 7, 2025
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 spacefor better preservation of detailsimplemented via SIMD operationsfor a better performance
Zekfad commentedMay 23, 2025
@brendan-duncan fixed alpha issue and made some performance adjustments, I'm very pleased with downscaling results as of now |
brendan-duncan commentedMay 23, 2025
Awesome, I'll check it out soon. Thanks! |
Zekfad commentedMay 23, 2025
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. |
brendan-duncan commentedMay 23, 2025
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. |
Zekfad commentedMay 23, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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: |
brendan-duncan commentedMay 25, 2025
I'm not forgetting about this, just been busy with the family |
Zekfad commentedMay 25, 2025
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. |


Uh oh!
There was an error while loading.Please reload this page.
based on MIT licensedhttps://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.