Code Monkey home page Code Monkey logo

Comments (4)

jcupitt avatar jcupitt commented on June 15, 2024

Hi @Kinkazma,

I had a look but I'm not sure what needs fixing. I tried:

$ vips copy HDR_Map.avif x.heic
$ vipsheader HDR_Map.avif x.heic 
HDR_Map.avif: 8000x1600 ushort, 3 bands, rgb16, heifload
x.heic: 8000x1600 ushort, 3 bands, rgb16, heifload

So range is preserved.

I tried adding a profile to your test image:

$ vips copy HDR_Map.avif x.avif[profile=BT20202.icc]

And copying that to HEIC preserved the profile.

I looked through libheif and there's not a lot of information on how to read and write HDR images, so I'm unclear if anything needs fixing there.

Can you give any more details?

from libvips.

Kinkazma avatar Kinkazma commented on June 15, 2024

On my Mac, I used an HDR profile that belongs to the computer. It didn't work any better. I'm not sure what's not working. I don't have coding skills, I do photography so it's not easy either. However, I already have HEIC files that contain HDR information if you're interested. But they come from my iPhone.
HDR_P3_D65_ST2084.icc.zip

from libvips.

jcupitt avatar jcupitt commented on June 15, 2024

This discussion has a bit more info:

#3153

Your original HDR_Map.avif is a 16 bit image and it's correctly read as 16 bits everywhere. It does not have an ICC profile, but perhaps if you attach the correct profile it'll appear as HDR? I'm unclear.

You can also have an HDR image which is a plain SDR, plus an extra gain map image. Yours does not have a gain map, it seems to be a regular 16 bit file.

$ heif-convert HDR_Map.avif x.png
File contains 1 image
Written to x.png

We'll probably need the help of an expert to make any more progress :(

from libvips.

jcupitt avatar jcupitt commented on June 15, 2024

You can also write high bit depth HEIC like this:

$ vips copy k2.jpg b.heic[Q=65,bitdepth=10]
$ vipsheader -a b.heic
b.heic: 1450x2048 ushort, 3 bands, rgb16, heifload
width: 1450
height: 2048
bands: 3
format: ushort
coding: none
interpretation: rgb16
xoffset: 0
yoffset: 0
xres: 1
yres: 1
filename: b.heic
vips-loader: heifload
exif-data: 186 bytes of binary data
...
heif-primary: 0
n-pages: 1
heif-compression: hevc
bits-per-sample: 10

So libvips is showing as 16 bits, but the bits-per-sample metadata field shows the file is really 10 bits internally. Presumably, with the right profile, you could write HDR like this.

from libvips.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.