-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Depth Images support #83
Comments
Yes please :) |
I'll try to add support for |
Signed-off-by: Alexander Piskun <[email protected]>
im = Image.open("../tests/images/heif_other/pug.heic")
depth_im = im.info["depth_images"][0] # we know that there is a depth image
# depth images are just `class HeifDepthImage(BaseImage)`, so work with them as usual pillow_heif's image
# depending on for what you need depth image you can convert it to numpy array or convert to pillow
pil_im = depth_im.to_pillow()
np_im = np.asarray(depth_im)
print(pil_im)
print(pil_im.info["metadata"])
|
Hi @bigcat88 thanks a lot for taking a look at this! We're trying to visualize datasets of photos taken by iPhone, so I have no examples outside this use case. Depth is important to our use case because we compare it to depth data created for the photos by external machine-learning algorithms. The HDR Gain Map data is less important to us specifically (but it could be nice for "completeness" of the visualization options we display to users). |
done, new version is out |
Hi @bigcat88, thank you for this useful library. Can you add this snippet to access depth image to the README file, so that it is more accessible? I keep going back to this issue just to see this snippet. I think others will appreciate this feature too :) |
Good point, thanks and done! |
Is there any support for save HEIF with depth images ?I try put it in |
No, libheif does not currently have an API for this. I advise you to create a question there with a request to add such an API to their soon to be released version 1.18 |
In this commit I have added an example of such heic file taken on iPhone.
Here is the primary image:
Here is the depth image:
Here is an Aux image(urn/apple_photo/2020/aux/hdrgainmap):
Does anyone need the opportunity to read them?
The text was updated successfully, but these errors were encountered: