Skip to content
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

image scaling filters #245

Open
Kaito0 opened this issue Aug 22, 2023 · 14 comments
Open

image scaling filters #245

Kaito0 opened this issue Aug 22, 2023 · 14 comments
Labels
enhancement New feature or request help wanted Extra attention is needed reader:image Issues related to manga/comic reader of the app

Comments

@Kaito0
Copy link

Kaito0 commented Aug 22, 2023

I like the reader! However, adding an option for various scaling algs would benefit user experience, i.e lanczos, sinc, mitchel etc. Yomikiru has a Bilinear scaling, which produces softer than desired look in =< 1080p configurations (a single image fit to width)/ except for vertical 1080p. Thanks!

@Kaito0 Kaito0 added the enhancement New feature or request label Aug 22, 2023
@omodia
Copy link

omodia commented Aug 22, 2023

For reference.
Except for text in some algorithms, images do not look good in all algorithms.

@mienaiyami
Copy link
Owner

For reference. Except for text in some algorithms, images do not look good in all algorithms.

They didn’t mean it that way.

I have wanted to do this for a long time, hence I kept the “canvas-based renderer” around even after the scrolling issue was fixed. It just had a lower priority on my list.

@mienaiyami
Copy link
Owner

Also, with "canvas-based renderer" off, it uses native image element to display images for performance and low RAM usage.
This feature will likely depend on "canvas-based renderer" so you can expect a lot higher RAM usage.

@omodia
Copy link

omodia commented Aug 22, 2023

Also, with "canvas-based renderer" off, it uses native image element to display images for performance and low RAM usage.

You mean, it displays the original image, when canvas-based renderer is off, right?

@Kaito0
Copy link
Author

Kaito0 commented Aug 22, 2023

@Kaito0
Copy link
Author

Kaito0 commented Aug 22, 2023

With canvas on image is sharp, but not ideal (visible patterns) - it's close to what Nearest-neighbor filter would do ~
Example with canvas on -- 1280 x 1024, hq source
yomikiru https://drive.filen.io/d/0dfed07f-118d-4d14-b84c-f2154e9ece97#hbNNK58NvtrpiSm4AEjarMXuCk8M7qYV (notice artifacts -- woman's hair, cell like patterns on the table and so on)
lanczos filter https://drive.filen.io/d/ed67b1f7-3e3a-4fc2-80da-ccecd41d75e9#seX7lfnaDpcNqy1nvIRwyhm1tASRRPpE

@omodia
Copy link

omodia commented Aug 22, 2023

example -- 1280 x 1024 screen and hq source, canvas renderer disabled
yomikiru https://drive.filen.io/d/1f5db3c5-9528-48ef-92c4-6f64a7b16c29#6ydq2agSs94fpZd1mxQF8BM1wjjVQ32r
other reader app https://drive.filen.io/d/6a7199a6-002b-4550-8d4e-82eafd568df9#mGccN0CnIXcZvsOP7Fm88OB9xELTqgwW

  • The 1:1 option in your reader settings is not selected, it is why you see a little blur.
  • Open any manga -> reader settings -> fit options -> 1:1.
  • I have also compared some other images by uploading the same image in yomikiru and chrome. After selecting 1:1 option in yomikiru and left clicking the mouse button in chrome for it to show the original image, I entered full screen in both.
  • I did not see any change between the images. So, make sure to enable 1:1 option in reader settings.

1

@Kaito0
Copy link
Author

Kaito0 commented Aug 22, 2023

obviously yes it would provide identical to source result in 1:1 mode, as it dosn't scale image to screen size. 1.1 mode is unusable for 1080p or less, due to a simple fact that image is generally too big to fit. So there is downscaling for that. You would also benefit from filtering (and scaling/fitting) when you upscale 1080p image to a larger screen resolution like 4k or 5k, otherwise your image will be too small :)

@omodia
Copy link

omodia commented Aug 22, 2023

This feature will likely depend on "canvas-based renderer" so you can expect a lot higher RAM usage.

They will be useful for upscaling and also depended on canvas, so it would not affect ram without enabling it.

@mienaiyami
Copy link
Owner

If possible, can you provide more info on this?
I'm having hard time understanding many things because I'm not familiar with this like

  • what should the image be rescaled to? (is it 1:1 pixel of screen?)
  • should it be rescaled every time reader size is changed? (if so it will be very resource intensive)

There were more questions but i cant remember them for now, so I will ask multiple times.

@mienaiyami mienaiyami added help wanted Extra attention is needed reader:image Issues related to manga/comic reader of the app labels Sep 18, 2023
@Akkusativ31
Copy link

I dont know the details of how it can be implemented, but people including me just want the resizing algorhitm to be changeable from Bilinear to lancroz which the benefits of can be seen above.
CDisplayEx has this feature and adding it to yomikiru would make this program perfect, thanks for your work.

@mienaiyami
Copy link
Owner

Normal users ignore this comment.

@Owyn
Copy link

Owyn commented Feb 23, 2024

+1

Biliniar doesn't seem a good choice anyway, even in that wiki link - Bicubic seems much better (and it's usually chosen as a default medium quality option everywhere)
image

but a killer-feature would be to have an option to use https://github.com/nagadomi/waifu2x upscaling

cuz sadly even now in 2024 there are tons of places where comic images are provided in downscaled as heck format

@mienaiyami
Copy link
Owner

Its actually not bilinear for every image. Because of internal optimizations, when "upscaling" ie size of image displaying is larger than original resolution, it will use linear interpolation. But when downscaling it uses lanczos3.

As I have said above, Yomikiru dont handle image rendering by default because it can be complex in resource management (which you can already notice in "canvas based rendering", it uses a lot higher amount of RAM and CPU).

Resampling images is very expensive task and takes lot of RAM and CPU time. Even with "Magic Kernel Sharp", which is faster than lanczos3, it takes too long to load the images.
Im still working on the solution to load without big initial loading time, will be releasing this as experimental feature when that is done atleast.

In case of CDisplayEx, I think it only shows one or two image at a time, thats how its able display manga fast. Even when resizing, you can notice a big delay before image resolution (not size) updates.


And as I have already mention in #289, its not possible to use waifu2x (+ it takes significantly longer to resample).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed reader:image Issues related to manga/comic reader of the app
Projects
Status: Todo
Development

No branches or pull requests

5 participants