HEIC depth information

Started by Milk_Dream, December 21, 2020, 06:50:10 AM

Previous topic - Next topic

Milk_Dream

Hi everyone!

I lost few days (overall) to understand how I can do this. And I got it. I can't. I'm sorry for this question, really read all about this problem, and can't find solution for me.
I have .HEIC file from iPhone, captured in portrait mode. And I need extract depth mask from photo for edit in Ps. I use OS Windows 10 and this function is not default, unfortinetly in Ps. I try use Imagemagick to convert in .jpg and then extract depth mask with exiftool command -b -MPImage- not work. But if I extrct mask from jpg generated from iPhone- all work.

I really ask for help. Thank you!
Unfortunately, I am very weak in command line tools :(

Phil Harvey

Could you send me a sample HEIC file with a depth map so I can take a look (philharvey66 at gmail.com)?

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Phil Harvey

I got the image you sent.  I've taken a quick look but can't see where the depth information is stored.  I'll have to take a more detailed look at this later when I have a chance.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Milk_Dream

Thank you very much!

Couple addition: if open this photo with lightroom (on Windows), Lightroom can show mask, but can't export It. And I will send you addition image, just in case, automatically generated from phone.

Milk_Dream

I found info about "Auxiliary Image Storage", HEIC store additional info in auxiliary image storage, like depth map or alpha channel.. But I can't find this data on file :(

Milk_Dream

#5
New adiddion: if create in lightroom "smart preview" from .heic and open smart preview (smart preview automatically saved in .dng) in camera raw- depth mask avaible in camera raw! I think, this mean what data about depth stores somewere in heic...

I'am sorry for spamming- I try find answer from 2018 :))
And I'm sorry for mistakes :(

UPD
But if use command in Lightroom "Export" and export to jpg- information about depth not saves (maybe)

Milk_Dream

maybe last thing- maby depth data in HEIC store in text data, not image like in jpg... And if its true, how we can export it in image...


Phil Harvey

I've taken a close look at the file.  The depth-map information is stored as hvc1-compressed data.  It is item number 51 in the ItemInformation directory.  From the ExifTool -v3 output:

  | Item 51) 'hvc1' (13669 bytes)
  |   12f5f6: 00 00 35 61 28 01 af 09 0b 45 26 0a 04 d8 b7 34 [..5a(....E&....4]
  |   12f606: 86 8d b9 c5 55 48 34 fe 33 67 07 ba 5a 32 5b 4b [....UH4.3g..Z2[K]
  |   12f616: 30 5a 55 ba 44 48 74 9b d5 3f 63 64 10 13 0e d2 [0ZU.DHt..?cd....]
  |   12f626: 65 96 8b 2a c1 f8 27 ce 3f d4 b8 ad ca 85 86 fe [e..*..'.?.......]
  |   12f636: 62 25 2e c2 e2 80 ee d1 76 2e ca 84 b5 f0 a2 b0 [b%......v.......]
  |   12f646: 59 41 7d a8 da fe ca df 73 03 3b 2b 30 1f c2 71 [YA}.....s.;+0..q]
  |     [snip 13573 bytes]


In general, ExifTool only extracts stand-alone file formats that are embedded within another file, which this definitely is not.  Turning this depth map information into a useable file would be difficult.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).