Post not yet marked as solved
In my app I get a UIImage for a PHAsset via PHImageManager.requestImage(for:targetSize:contentMode:options:resultHandler:). I directly display that image in a UIImageView that has preferredImageDynamicRange set to .high. The problem is I do not see the high dynamic range.
I see the HDRDemo23 sample code uses PhotosPicker to get a UIImage from Data through UIImageReader whose config enables prefersHighDynamicRange.
Is there a way to support HDR when using the Photos APIs to request display images?
And is there support for PHLivePhoto displayed in PHLivePhotoView retrieved via PHImageManager.requestLivePhoto?
Post not yet marked as solved
I am trying to display HDR Images (ProRAW) within UIImageView using preferredImageDynamicRange. This was shown in a 2023 WWDC Video
let imageView = UIImageView()
if #available(iOS 17.0, *) {
self.imageView.preferredImageDynamicRange = UIImage.DynamicRange.high
}
self.imageView.clipsToBounds = true
self.imageView.isMultipleTouchEnabled = true
self.imageView.contentMode = .scaleAspectFit
self.photoScrollView.addSubview(self.imageView)
I pull the image from PHImageManager:
let options = PHImageRequestOptions()
options.deliveryMode = .highQualityFormat
options.isNetworkAccessAllowed = true
PHImageManager.default().requestImage(for: asset, targetSize: self.targetSize(), contentMode: .aspectFit, options: options, resultHandler: { image, info in
guard let image = image else {
return
}
DispatchQueue.main.async {
self.imageView.image =image
if #available(iOS 17.0, *) {
self.imageView.preferredImageDynamicRange = UIImage.DynamicRange.high
}
}
}
Issue
The image shows successfully, yet not in HDR mode (no bright specular highlights, as seen when the same image ((ProRAW) is pulled on the native camera app.
What am I missing here?
Post not yet marked as solved
Hello! After recent talk on the WWDC2023 about HDR support and finding this documentation page on Applying Apple HDR effect on photos, I became very interested in the HDR Gain Map format. From documentation page it is clear how we can restore original HDR from SDR and Gain Map representation, but my question is - how from HDR we can convert back to the SDR + Gain Map representation? As I understand right know, conversion from HDR to SDR + Gain Map includes two steps:
Tone mapping of HDR for getting correct SDR
When we have both HDR and SDR, from equation in the documentation page we can calculate Gain Map
Am I correct? If so, what tone mapping algorithm for HDR -> SDR conversion is used right know? Can't find any information about this in the internet:(
Would be very grateful for your response!
Post not yet marked as solved
Hi,
With iOS17 adding APIs to display and handle HDR images in apps, is the AVAssetImageGenerator supposed to generate CGImages with an HDR color profile (when the AVAsset is an HDR video)?
I cannot get it to work, in the simulator or on the device : the colorspace of the CGImage seems to always be kCGColorSpaceModelRGB, no matter how I configure the AVAssetImageGenerator.
So the created UIImage is not displayed as an HDR image in a UIImageView (with preferredImageDynamicRange set to UIImageDynamicRangeHigh)
Is there another known way to generate an image at a specific time of an AVAsset?
Post not yet marked as solved
I've followed the instructions in the WWDC23 presentation entitled "Support HDR images in your app" (wwdc2023-10181), but I am unable to see any HDR effect with my test photos. The Apple photos app shows the photos with the "HDR" tag and has the HDR effect.
Has anyone else been able to replicate what was done in the presentation in their app?
Is this truly supported by iOS 17 on an iPhone 13 pro with Xcode 15.0 beta? Or do we need to wait for the next beta release of iOS/Xcode? Or is there some missing information from the presentation?
Post not yet marked as solved
I understand that Apple fully implemented the ITU-R BT.2100 PQ and HLG transfer types for various image formats. I’m working on a project where I have a dng file as an input and I need to save the modified file as heif. Which transfer method should I choose? Does it matter?