Bug 218719

Summary: APNG can be rendered with wildly incorrect (inverted) colors
Product: WebKit Reporter: Jonathan Deutsch <jonathan>
Component: ImagesAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: jonathan, sabouhallawa, smoley, thorton, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Safari 14   
Hardware: All   
OS: macOS 10.15   
Attachments:
Description Flags
problem image and source pngs
none
Safari (incorrect) vs Chrome (correct) none

Description Jonathan Deutsch 2020-11-09 11:47:05 PST
Created attachment 413612 [details]
problem image and source pngs

The attached "animated.png" does not render properly in Safari 14 or STP 115.  The coloring on some frames can be extremely incorrect.

- This does not happen when using Quick Look in the Finder
- This does not happen in Chrome

The PNG was generated with apngasm via:

```
apngasm -o animated.png -d 33 -l 1 --force sources/*.png
```

This affects content created by Tumult Hype: https://tumult.com/hype/
Comment 1 Jonathan Deutsch 2020-11-09 11:49:34 PST
Created attachment 413613 [details]
Safari (incorrect) vs Chrome (correct)

Attached image of how it looks in Safari vs. Chrome.

Sometimes a refresh is required in Safari to render like this.
Comment 2 Smoley 2020-11-09 12:18:21 PST
Thanks for filing. Apple internal see:
rdar://60165443
Comment 3 Said Abou-Hallawa 2020-11-09 15:41:01 PST
Yes the red and the blue channels are exchanged in the frames of the APNG in WebKit.
Comment 4 Tim Horton 2020-11-11 11:11:34 PST
Only reproduces with accelerated drawing on, so this is underneath us. Thank you for the report! Feel free to file a bug at feedbackassistant.apple.com if you want to track the status, but I'll also route the one mentioned above to the right place.
Comment 5 Jonathan Deutsch 2020-11-11 11:23:14 PST
Thanks for promptly looking into this.