libvips / nip2

A spreadsheet-like GUI for libvips.
https://libvips.github.io/libvips/
GNU General Public License v2.0
351 stars 13 forks source link

colourspace scRGB questions (nip2) #65

Open DavidRosen opened 7 years ago

DavidRosen commented 7 years ago

Is there somewhere else I should be posting questions like these?

  1. How can I transform an image to a linear-rgb colourspace such as scRGB (say, from sRGB), as I don't see this as a choice in the Colourspaces menu?

  2. Is there another linear-rgb colourspace that I could transform to, where numeric values of zero represent zero light? My understanding is that scRGB has an offset.

  3. Why does an scRGB image get darker when transformed to another colourspace? I started with a version of memorial.hdr that I had already normalised it to [0,1] (so there would be no need for further normalisation in a colourspace transformation), but then when transforming it to either sRGB or Lab it gets much darker still.

I'm using nip2 8.4.0 under Windows 7.

jcupitt commented 7 years ago

Hello David, no, this is the best place for questions.

  1. libvips has had scRGB for a few years, but I've never got around to adding it to the nip2 menus, I must do this.

  2. XYZ is the simplest linear space that nip2 supports.

  3. It looks like HDR is a bit broken in nip2. If you run vips copy uffizi_probe.hdr x.jpg at the command-line, it looks fine, but Radiance / Unpack, then convert to sRGB is missing something. I think this is the poor scRGB support.

Give me a 'mo, I'll add scRGB to 8.6.

The current stable version is 8.5, by the way, it has a few fixes over the 8.4 you are using:

https://github.com/jcupitt/nip2/releases

DavidRosen commented 7 years ago

Thanks! Is there another hdri-capable image format that nip2 can import (or export) for exchange with other software? (I tried reading pfm but the result looked almost black, regardless of whether the data was linear or sRGB.)

jcupitt commented 7 years ago

I've added scRGB supprt, and improved HDR handling. It seems to work. I'll make you a test build.

nip2 supports float tiff, that should work, though I don't know if many other packages can read it.

PFM ought to work too, perhaps it's confused by the 0 - 1 range of scRGB? You could try multiplying by 256 before saving.

DavidRosen commented 7 years ago

Thank you.

Perhaps the scale factor in the PFM header is not being interpreted or applied correctly?

I multiplied a PFM image by 255 in ImageMagick and then read the result into nip2. It looked about right except that it was upside-down (mirror-flipped top-to-bottom).

Yes, I'd be interested to try a Windows test-build if you could provide one.