with jpeg format, I know can use:
exiftool -b -MPImage2 test-lumen.jpg > depthMap.jpg
But if the format is Heic, there is any method can export the HDR gain Map?
You need to be able to extract Apple specific metadata first.
It's documented here: