Dudemanguy / mpv-manga-reader

Manga reading script for mpv
GNU General Public License v3.0
120 stars 4 forks source link

Conversion from gray to rgb24 in double page mode causes artefacts #30

Closed McBaws closed 4 months ago

McBaws commented 4 months ago

There are weird yellow outlines when viewing these images in double page mode. Might be a problem with whatever filters are being used for the format conversion.

Original files: test.zip Tokyo Ghoul - re - c125 (v12) - p064  dig   VIZ Media   DigitalMangaFan  - 00_00_00 000 - 01

Dudemanguy commented 4 months ago

The problem is that mpv's autoconverter is kicking in here on the black page:

[autoconvert] Converting pal8 -> argb

The script is converting the gray page to pal8 not argb. This is what is causing the artifact. Not really sure what the best solution is yet for this edge case.

Dudemanguy commented 4 months ago

So I experimentally tested all of the possible format conversions mpv may do internally (which is based on ffmpeg apis of course), at it turns out that gray with any format besides another gray format will always pick argb as the best format. So in fact, I can simplify the entire format conversion business and always use argb when we have gray pages.