edeso / bubble2

Android Comic Book Reader/Image Archive Viewer. Simple yet comfy. Open PDF, RAR, ZIP, 7Z, TAR files. Display BMP, JPG, GIF, PNG, WebP and JP2/J2K images.
https://github.com/edeso/bubble2
GNU General Public License v3.0
25 stars 2 forks source link

Scaler used? #13

Open srappan opened 2 months ago

srappan commented 2 months ago

Hiya

Could you mention in the README what scalers are used to upscale and downscale the image? Or whether if it configurable?

edeso commented 2 months ago

hmm have to dig in.

i know there is no upscaling in the app. downscaling is done by subsampling (halfing resolution) until it fit's memory limit. will need to look into the implementation for details.

why do you ask? any issues?

srappan commented 2 months ago

A lot of downscaling methods can cause unwanted artifacts and make the image worse. (Added ringing, haloing)

I would recommend looking into image scalers. Imagemagick has extensive information https://www.imagemagick.org/Usage/filter/#hermite

Mitchell is usually recommended over Hermite for manga and comics to preserve screen tones, so I would recommend Mitchell as default downscaling kernel.

If you could link the bit of code that does scaling, I can possibly advise further.

12 Apr 2024 11:33:03 edeso @.***>:

hmm have to dig in.

i know there is no upscaling in the app. downscaling is done by subsampling (halfing resolution) until it fit's memory limit. will need to look into the implementation for details.

why do you ask? any issues?

— Reply to this email directly, view it on GitHub[https://github.com/edeso/bubble2/issues/13#issuecomment-2051500679], or unsubscribe[https://github.com/notifications/unsubscribe-auth/AGM2TO6EYJK52S323S3TGYTY46Z57AVCNFSM6AAAAABGD4HRI2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANJRGUYDANRXHE]. You are receiving this because you authored the thread. [Tracking image][https://github.com/notifications/beacon/AGM2TO6CC36EGITWCXV4Z5LY46Z57A5CNFSM6AAAAABGD4HRI2WGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTT2I5VIO.gif]

edeso commented 2 months ago

feel free to dig in. would have to search myself. been a while since i touched that code.

and again

  1. i am not aware of any up-/downscaling in the app, except the subsampling during load which is not tunable in any way.
  2. i am not aware of artifacts introduced due to any type of resampling from the app. if you find any i my be persuaded to investigate
srappan commented 2 months ago

Are you using this library per chance? If so, tachiyomi used it too and you can see the visual difference in the comparison to lanczos used by perfectviewer below. https://slow.pics/c/Ak1KHcAS

12 Apr 2024 11:52:24 edeso @.***>:

feel free to dig in. would have to search myself. been a while since i touched that code.

and again

  1. i am not aware of any up-/downscaling in the app, except the subsampling during load which is not tunable in any way.
  2. i am not aware of artifacts introduced due to any type of resampling from the app. if you find any i my be persuaded to investigate

— Reply to this email directly, view it on GitHub[https://github.com/edeso/bubble2/issues/13#issuecomment-2051528983], or unsubscribe[https://github.com/notifications/unsubscribe-auth/AGM2TO7J26ICV7FPUH6HIK3Y464GPAVCNFSM6AAAAABGD4HRI2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANJRGUZDQOJYGM]. You are receiving this because you authored the thread. [Tracking image][https://github.com/notifications/beacon/AGM2TO5GS7IGG6PJWDE43SDY464GPA5CNFSM6AAAAABGD4HRI2WGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTT2I7MRO.gif]

edeso commented 2 months ago

again, there is no scaling in Bubble2 . there is merely subsampling, did you try it? do you see artifacts? please provide screenshots.

of course there is scaling by the display driver (usually OpenGL), but that is outside of the app scope as well. a common issue is a Moire Pattern and only fixable by costly realtime image manipulation according to scale/display/image-resolution.

any way. please provide artifacts created by Bubble2 in your comics/mangas. if there are none i see nor reason dive in any further.

there are loose plans to integrate smoeting along the lines of https://github.com/davemorrissey/subsampling-scale-image-view in the future. but there is no urgency as of now.