Bug 216943 - Chroma subsampling based on encode quality
Summary: Chroma subsampling based on encode quality
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Canvas (show other bugs)
Version: Safari 14
Hardware: Mac macOS 10.15
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-09-24 14:36 PDT by Micah
Modified: 2021-01-28 14:58 PST (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Micah 2020-09-24 14:36:28 PDT
Hi,

One unresolved browser inconsistency in the Canvas API is how image encoding quality affects chroma subsampling. 

In Firefox, chroma subsampling is turned off at quality >= 0.9, allowing crisp images to be exported from Canvas at relatively small file sizes (e.g. quality 92%). Chrome & Webkit only disable chroma subsampling at quality == 1.0 (100%), meaning that it's impossible to export a crisp canvas as a JPEG without also exporting a massive image.

I work at an online photo editor, and it means that we recommend Safari users save their images at 100% quality, and then use a different program to compress them (w/out chrome subsampling) before using them on a website. Other online photo editors bypass the browser altogether and load their own version of libjepg in WebAssembly. This seems a bit heavy-handed, and it'd be great if the browser default for Canvas produced images that were ready to use on the web.

Chrome recently opened a WHATWG issue for this, and it'd be great to hear from Safari. 
https://github.com/whatwg/html/issues/5395

Improving this small corner of the web platform would make Safari a better platform for our users. Thanks!
Comment 1 Radar WebKit Bug Importer 2020-09-27 10:06:46 PDT
<rdar://problem/69660091>
Comment 2 Micah 2021-01-28 14:58:08 PST
Any thoughts on this? It'd be great to hear from the Webkit team. Thanks!