This is not a bug per say - it's a question on how to use gpac/MP4Box to re-combine photo+depthdata into an HEIC file. 

- [X] I looked for a similar issue and couldn't find any.
- [X] I tried with the latest version of GPAC. 
- [X] I give enough information for contributors to reproduce my issue  - An HEIC photo with depth map -  https://drive.google.com/file/d/17-1If40KBVrbMulTZhF4469fWL5MZuVE/view?usp=sharing


So, extracting depth map from HEIC is pretty simple these days - heif-convert does it for free when you do a conversion, spitting out everything that is inside an HEIC file, from depth maps to semantic segmentation maps. 

On the HEIC image I'm sharing on google drive link above (yes, I need to trim my beard!! LoL), you can run `heif-convert 0089.HEIC 0089.jpg` and it will spit out not only the depth map, but also a few semantic segmentation masks for skin, hair, glass, etc. Also, `heif-info 0089.HEIC` will output this: 
```
MIME type: image/heic
image: 2316x3088 (id=36), primary
  thumbnail: 240x320
  color profile: prof
  alpha channel: no
  depth channel: yes
 (480x640)
    z-near: undefined
    z-far:  undefined
    d-min:  0.149780
    d-max:  3.218750
    representation: uniform disparity
    disparity_reference_view: 0
```

> note the depth map data is actually attached in the HEIC file as `depth channel`... it is important to be able to re-create the HEIC with depth data in the actual `depth channel` as this image have, not just like an extra image  like segmentation masks are!

What I'm trying to do now is re-create the HEIC file, with the original RGB color image AND the original depth map stored in the actual depth channel of the new HEIC file.

From the documentation and examples, it seems MP4Box may be able to do this, but I couldn't find any documentation explaining how to do it, so I'm not sure if it can at this point. 

The whole reason I'm trying to do this is so I can edit the photo image, masking out regions of it to use with photogrammetry, but I need to re-combine the depth into a HEIC file so apple's new photogrammetry api on Reality Kit can "see" the depth data and use it to scale the model correctly. 

I'm sorry for logging this question as a bug, but I really want to ask this to you guys, and didn't know where I could ask but here. 

Thanks for any insight! I really appreciate!

-H

Looking for a way to create an HEIC file with depth map, just like the ones saved by iOS api. 
This is a GitHub Issue
repo:gpac
owner:gpac
Title : Looking for a way to create an HEIC file with depth map, just like the ones saved by iOS api. 
Issue date:

--- start body ---
This is not a bug per say - it's a question on how to use gpac/MP4Box to re-combine photo+depthdata into an HEIC file. 

- [X] I looked for a similar issue and couldn't find any.
- [X] I tried with the latest version of GPAC. 
- [X] I give enough information for contributors to reproduce my issue  - An HEIC photo with depth map -  https://drive.google.com/file/d/17-1If40KBVrbMulTZhF4469fWL5MZuVE/view?usp=sharing


So, extracting depth map from HEIC is pretty simple these days - heif-convert does it for free when you do a conversion, spitting out everything that is inside an HEIC file, from depth maps to semantic segmentation maps. 

On the HEIC image I'm sharing on google drive link above (yes, I need to trim my beard!! LoL), you can run `heif-convert 0089.HEIC 0089.jpg` and it will spit out not only the depth map, but also a few semantic segmentation masks for skin, hair, glass, etc. Also, `heif-info 0089.HEIC` will output this: 
```
MIME type: image/heic
image: 2316x3088 (id=36), primary
  thumbnail: 240x320
  color profile: prof
  alpha channel: no
  depth channel: yes
 (480x640)
    z-near: undefined
    z-far:  undefined
    d-min:  0.149780
    d-max:  3.218750
    representation: uniform disparity
    disparity_reference_view: 0
```

> note the depth map data is actually attached in the HEIC file as `depth channel`... it is important to be able to re-create the HEIC with depth data in the actual `depth channel` as this image have, not just like an extra image  like segmentation masks are!

What I'm trying to do now is re-create the HEIC file, with the original RGB color image AND the original depth map stored in the actual depth channel of the new HEIC file.

From the documentation and examples, it seems MP4Box may be able to do this, but I couldn't find any documentation explaining how to do it, so I'm not sure if it can at this point. 

The whole reason I'm trying to do this is so I can edit the photo image, masking out regions of it to use with photogrammetry, but I need to re-combine the depth into a HEIC file so apple's new photogrammetry api on Reality Kit can "see" the depth data and use it to scale the model correctly. 

I'm sorry for logging this question as a bug, but I really want to ask this to you guys, and didn't know where I could ask but here. 

Thanks for any insight! I really appreciate!

-H

--- end body ---
