-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
PEP 12: Update outdated image and comment formatting guidance #2365
PEP 12: Update outdated image and comment formatting guidance #2365
Conversation
Any browser-friendly graphics format is possible; PNG should be | ||
preferred for graphics, JPEG for photos and GIF for animations. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"PNG should be preferred for graphics, JPEG for photos" where does this guidance come from?
Equally, do we want to allow animated GIF images in a PEP?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"PNG should be preferred for graphics, JPEG for photos" where does this guidance come from?
For one thing, from the name of each format, following from their defined purpose and fundamental to how their respective compression strategies were designed.
The Joint Photographic Experts Group format was developed to use for, well, photographs, and its DCT-based compression handles their complex scenes, smooth gradients and high degrees of color variability well, but performs poorly on graphics, resulting in visibly inferior quality yet larger file size.
By contrast, Portable Network Graphics was explicitly created for, well, graphics, and uses a lossless DEFLATE + pre-filtering compression scheme plus color paletting to achieve excellent compression ratios on images with vector-style art, fewer discrete colors and defined shapes. but hugely balloons file size on photographs and similar relative to even a visually-lossless JPEG.
Equally, do we want to allow animated GIF images in a PEP?
I don't really have any opinion here; we can remove that if others do. I included it because it was mentioned in the original text (TIFF was elided, as it is not at all web-friendly and its use cases for this were better covered by JPEG and PNG).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the explanation. To an extent my challenge was do we really need to care about the differences between JPEG and PNG. It's rare enough though that we can take case by case if need be.
A
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need a long explanation, but I don't think it hurts to spend a mere few words briefly mentioning which format to use for what, when we're bringing up the formats anyway.
7b2ad47
to
3b6556b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, looks good.
Any browser-friendly graphics format is possible; PNG should be | ||
preferred for graphics, JPEG for photos and GIF for animations. | ||
Currently, SVG must be avoided due to compatibility issues with the | ||
PEP build system. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of scope here, so just a note as accessibility is mentioned in the next paragraph, SVGs can be good for accessibility.
(Although it might require more work to create an accessible SVG than is usually put into images here.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mmm, good point. One more reason for PEP 676, which should get them working, hopefully.
Presently, PEP 12's guidance on including and describing images is thoroughly outdated and does not reflect the present reality, well-established best practices nor accessibility standards. This PR updates it to do so, by: