07th-mod / watanagashi

43 stars 16 forks source link

White artifacting around scenario text #109

Closed drojf closed 2 years ago

drojf commented 3 years ago

I noticed there was this white artifacting around the text displayed before you start the game (click to view fullsize):

Capture

I previously saw this issue with the italian translation's image assets, and fixed the issue by running the images through pngrim (if you want a binary for pngrim, you can download it here: https://github.com/drojf/pngrim/releases/tag/v1.0.0).

You can read about what causes this issue here: http://www.adriancourreges.com/blog/2017/05/09/beware-of-transparent-pixels/. In short, if the transparent pixels near the edge of an image don't match the color of the non-transparent pixels, you'll get this kind of artifacting with programs which use premultiplied alpha (premultiplied alpha is commonly used in games). with programs which both use straight alpha and also use a form of texture filtering which produces artifacts during transforms (GPU image scaling etc. used in games can cause this).

Here are the fixed image assets, run through .pngrim (probably not all of them have the problem, but I ran pngrim through them anyway):

wata_scenario_text_white_artifact_fix_2020-12-02.zip

I haven't checked the other chapters for this issue, only Watanagashi.

enumag commented 3 years ago

I would make no sense for this issue to exist only in watanagashi. It might be specific to some installations though, I don't think my wata installation is suffering from this. I'll check when I get home.

TellowKrinkle commented 3 years ago

you'll get this kind of artifacting with programs which use premultiplied alpha

which *don't use premultiplied alpha

drojf commented 3 years ago

I'm not sure my understanding is correct - isn't the problem because the images are not created correctly for programs which use premultiplied alpha?

As in, if Higurashi didn't use premultiplied alpha (if higurashi used straight alpha) it would display OK as it would display the same as it does in photoshop which uses straight alpha.

I guess I can't rule out there being another phenomenon causing this, though.

drojf commented 3 years ago

Actually, wait I think I get it - so the issue actually comes from the image being resized and the alpha channel also being resized (or the image not being at a integer pixel offset, other transforms etc.)....I guess I misinterpreted the the article when I read it, or I misremembered it as I read it quite a while ago....