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

Lack of support for Pixel Aspect Ratio (PAR) for images #73

Closed
sdsnatcher opened this issue Feb 3, 2018 · 5 comments
Closed

Lack of support for Pixel Aspect Ratio (PAR) for images #73

sdsnatcher opened this issue Feb 3, 2018 · 5 comments

Comments

@sdsnatcher
Copy link

sdsnatcher commented Feb 3, 2018

I talked with Ian Hickson about this issue, and he directed me here.

I would like to bring to your attention that the Pixel Aspect Ratio (PAR) is still not rendered correctly by any of the current browsers I tested. This is a metadata present inside JPG, PNG and GIF files.

A lot of content was created in the 80's and 90's that had non-square pixels.

For example, many legacy pixel art based on non-square pixels (*1) are being destroyed, as the use case is still present and the users are doing workarounds by artificially stretching the images via resize to have the desired aspect ratio. Once the image is stretched like this, it's nearly impossible to restore it.

The same issue affects all images (stills and video) captured from SDTV. NTSC had an effective resolution of 720x480, which means that it's pixels aren't square. Just like pixel art, users have no alternative other than artificially stretch the image to adjust it for square pixels, creating artifacts that will be impossible to cleanup later.

Inspired by the HTML AcidTests, I created the Pixel Aspect Ratio Acid Test, that can be seen in the link below. It will check if the browser renders two sets of images correctly.

http://frs.badcoffee.info/PAR_AcidTest/

*1: Read C64, CGA, EGA, VGA (320x200), SNES, MSX, Amiga, PC88 and nearly the majority of devices from the 80s, when square pixels were still a luxury.

@sdsnatcher sdsnatcher changed the title Pixel Aspect Ratio (PAR) lack of support for images Lack of support for Pixel Aspect Ratio (PAR) for images Feb 3, 2018
@annevk
Copy link
Member

annevk commented Feb 3, 2018

I suspect we cannot support this without an opt-in attribute as it might be that there's content out there that relies on this metadata being ignored.

cc @svgeesus @tabatkins

@sdsnatcher
Copy link
Author

sdsnatcher commented Feb 3, 2018

Humm. Albeit not prevalent, since cameras and image editors set the PAR correctly (or leave it unset) there might be some cases here and there with images generated by unusual tools.

But here's some food for thought:

Do you remember when the HTML AcidTests where released? A lot of content relied on distorted rendering done by one specific browser or another. There were even websites that explicitly required the use of that specific browser, so they could be "correctly" viewed.

I.e.: Photoshop is one application that forces the user to set the PAR correctly. It always render the images with the PAR informed by the file, unless the user specifically disable that option per image.

@annevk
Copy link
Member

annevk commented Feb 3, 2018

I don't remember the first Acid test, but I do remember that for subsequent tests the test sometimes changed because we found out what the test was asking for could not be shipped in browsers. In any event, it seems like this is a thing that browsers could measure the impact of, if there's sufficient interest.

@sdsnatcher
Copy link
Author

sdsnatcher commented Feb 3, 2018

Ok, I just wanted to raise the awareness about the issue.

There are some more modern use cases for the PAR that might get people interested. For example, it can be used as a form of lossy compression for animated GIFs, while still keeping a decent perceived image quality.

Also, subpixel rendering support for images (and not just fonts) becomes viable.

@annevk
Copy link
Member

annevk commented Feb 4, 2021

If you're still interested in pursuing this I recommend raising this with the https://wicg.io/ community. They might be able to help turn it into a proper proposal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants