getsidetrack / swiftui-pipify

A SwiftUI component for launching custom picture-in-picture experiences
MIT License
155 stars 14 forks source link

Images in p3 colorspace do not show up in the PiP window #7

Open jordibruin opened 2 years ago

jordibruin commented 2 years ago

FYI, we just discovered that images in P3 colorspace don't work for some reason.

image
jordibruin commented 2 years ago

SRGB Colorspace rafi-head-rgb.pdf

P3 Colorspace rafi-head.pdf

Sherlouk commented 2 years ago

For anybody stumbling across this discussion, Jordi and I have identified the issue and raised it as FB10531954 and FB10531882 on Apple's feedback tracker.

The bug appears to be within the ImageRenderer which we utilise to convert the SwiftUI view to an image. Given this is new in iOS 16, I hope this will be fixed in an upcoming beta and will keep an eye on this.

In the meanwhile we have identified two possible workarounds:

  1. Use a supported colour space/file format (PNG using RGB colour space appears to work fine)
  2. Wrap your images in UIImage first before passing to SwiftUI: Image(uiImage: UIImage(named: "XX")!)