-
Notifications
You must be signed in to change notification settings - Fork 481
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FR] Image scaling algorithms and sharpening #42
Comments
After digging through the code, it seems it uses davemorrissey/subsampling-scale-image-view library to display the images. So it probably depends on the functionality of that library what can be done in this app. I open an issue there to see if they bother to add it in their library. |
The last commit made in that repository was 4 years ago. I don't think the developers/maintainers will even read that issue. The possibilities are either you could rewrite it yourselves or wait for some contributor to pick up this issue and hopefully submit a PR (for which the chances are highly unlikely). |
https://www.imagemagick.org/Usage/filter/ I would recommend looking at imagemagick docs to learn about scalers Ewa_lanczos or ewa_hanning for upscaling default. |
That's a CLI tool though isn't it, I don't see a way to integrate that into Mihon in a sensible way, be it as a CLI tool or as bundled native libraries written out in C or something. |
I am aware, I was just mentioning the docs as useful for the theory behind image scalers, it's just math that's needs to be implemented, either using a existing library or written from scratch |
Basically a port of Tachiyomi/#10099 🤔 |
I think you severely underestimate what you're asking if this is how you describe it. Yes, it's "just math" the same way particle physics is "just smashing things together". These algorithms would have to be implemented in a more low level language like C or Rust to be even remotely fast. This is a Kotlin project and an Android app.
in the code and we're done. |
This isn't about DOWNscaling but UPscaling... |
Nevermind. When I replied, for some reason I had the idea that your post was about images that were higher resolution than the display. My bad. |
It's about both, since the same option would be sensible to offer for downscaling too. |
There is a library in cpp for this but it has to be ported to an AAR library. |
waifu2x works very well,Maybe refer to this program |
About Upscale |
What are the app size and performance implications of this, especially on lower end devices? Consider that Mihon can be run on an Android 8 e-reader |
I’ll have to be honest here, AI upscaling doesn’t excite me. The final product is basically a water color painting, and when it isn’t, that basically means that the source image was of already high enough quality. I’d much rather look at a somewhat blurry image with coherent lines than a mush of ink. |
Upscaling is much less of a concern for Mihon anyway, since the downsides of low quality images are not its problem really. But if there is an avenue to get downscaling of some description into Mihon, it would enable Mihon to mitigate/all of the Moiré effects of super-high quality images. |
100% agree. Some form of downscaling would be amazing. |
Need a device with Snapdragon 835 or higher. Program size will increase by tens of MB. I just wanted to express that some people do need upscale. waifu2x-ncnn-vulkan is actually very suitable for running on current phones. |
Very low resolution and AI upscaling is not always the best combination. Forget the art, letters would be unintelligible, due to their small size and post-upscaling artifacts. Although I can see it being maybe useful for mid-res images. |
As stated before, sources using low quality images is not something Mihon has to concern itself with. When users need higher quality images, they should find a different source that provides higher quality content or something. Moiré pattern interference is something related to how Mihon itself displays very-high quality images, that's why I keep pointing to downscaling. |
https://github.com/ser-gik/smoothrescale This appears to have all the relevant info to implement lanczos using libswscale from ffmpeg |
https://github.com/T8RIN/ImageToolbox Maybe this can help as reference. This app has many scaling modes for resizing images, it also has different versions of lanczos. I use Perfect Viewer for reading digital volumes with lanczos 3 and the results are drastically better for high resolution images compared to mihon. Please consider this, If mihon gets better at scaling images, it will become the all in one package for manga anyone would ever need for android. |
For reference, that app is using Aire. Aire is bundling C++ code and appears to be Android-specific or at least largely so. |
This should be a very high priority. Proper resampling methods need to be available, particularly because down-sampling manga is very prone to moiré due to screentone patterns. AI is completely unnecessary, this is just a matter of using higher quality resampling algorithms implementations. Surely there is some API available at some level for Android developers who need to resize textures before drawing to the screen? |
If anyone wants to help out on rewriting the image decider with https://github.com/libvips/libvips (which has resampling support) contact us @ discord. And since no one has anything productive to share I'll lock this thread. |
Describe your suggested feature
Often Manga scanlations have a lower resolution than modern phone and tablet screens, which means they will get scaled up while displaying them. This results in a blurry image, although slightly.
Modern devices should have enough power to support a better upscaling algorithm (for example Lanczos?) than bilinear and/or to apply a (customizeable) real time sharpening filter.
Going forward also local AI upscaling should be considered as a long term goal. Even current devices already have NPUs for accelerated AI applications, so it's not impossible.
tl;dr:
Other details
No response
Acknowledgements
The text was updated successfully, but these errors were encountered: