Post

Replies

Boosts

Views

Activity

Reply to How do I properly set tagged color data in MTKView and CIContext?
I think I solved it. I set the colorspace on the underlying CAMetalLayer of the MTKView (iOS/Catalyst does not let you set this directly on MTKView): Add the following code at the end of the init method in MTKImageView.swift: if let taggedColorSpace = image.colorSpace, let metalLayer = self.layer as? CAMetalLayer { metalLayer.colorspace = taggedColorSpace } All three images now properly display for me:
Topic: Graphics & Games SubTopic: Metal Tags:
Mar ’24
Reply to CAMetalLayer renders HDR images with a color shift
Regarding the "SupportingHDRImagesInYourApp" sample app from Apple: If I load a RAW image file, then it initially looks correct in the UIImageView class, but it doesn't seem to have enough dynamic range in Edit Mode when the adjustment sliders are displayed (colors seems slightly darker).
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
Boosts
Views
Activity
Jun ’24
Reply to How do I properly set tagged color data in MTKView and CIContext?
Update: If the colorspace supports wideGamut, then I set the colorspace in the CAMetalLayer to extendedSRGB, instead of the tagged colorspace: if let taggedColorSpace = image.colorSpace, let metalLayer = self.layer as? CAMetalLayer { metalLayer.colorspace = isWideGamutRGB ? CGColorSpace(name: CGColorSpace.extendedSRGB) : taggedColorSpace }
Topic: Graphics & Games SubTopic: Metal Tags:
Replies
Boosts
Views
Activity
Mar ’24
Reply to How do I properly set tagged color data in MTKView and CIContext?
I think I solved it. I set the colorspace on the underlying CAMetalLayer of the MTKView (iOS/Catalyst does not let you set this directly on MTKView): Add the following code at the end of the init method in MTKImageView.swift: if let taggedColorSpace = image.colorSpace, let metalLayer = self.layer as? CAMetalLayer { metalLayer.colorspace = taggedColorSpace } All three images now properly display for me:
Topic: Graphics & Games SubTopic: Metal Tags:
Replies
Boosts
Views
Activity
Mar ’24