Forum

Author Topic: TIFF/LAB files displayed in Black White only  (Read 7412 times)

tazzo

  • Full Member
  • ***
  • Posts: 162
    • View Profile
TIFF/LAB files displayed in Black White only
« on: August 27, 2023, 11:57:46 PM »
Hello,
I have photos in TIFF/LAB format (can be converted/created with Photoshop, Affinity Photo, etc..) to retain the full color gamut from RAW files.
Metashape can open them but they are displayed in Black and White only. The texture generated is monochromatic too.
Would be nice to have full support for this format
Thank you

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15118
    • View Profile
Re: TIFF/LAB files displayed in Black White only
« Reply #1 on: August 28, 2023, 03:55:20 PM »
Hello tazzo,

can you please send the example of such images to support@agisoft.com?
Best regards,
Alexey Pasumansky,
Agisoft LLC

tazzo

  • Full Member
  • ***
  • Posts: 162
    • View Profile
Re: TIFF/LAB files displayed in Black White only
« Reply #2 on: August 28, 2023, 09:13:53 PM »
Hello, I sent the images to your support email address

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15118
    • View Profile
Re: TIFF/LAB files displayed in Black White only
« Reply #3 on: August 29, 2023, 12:00:15 PM »
Hello tazzo,

The channels in the provided files are not marked as Red, Green, Blue, therefore Metashape shows only the first band in grayscale.

Also it seems that the channels are Y, Cb, Cr (at least according to information derived by ExifTool), so you need to use Raster Calculator in Metashape with appropriate formulas and False Color palette to display the images in RGB space.

But probably it would be easier to save the TIFF files in RGB space, so no additional operations are required in Metashape. Please also specify, what applications you use that display these images properly by default.
Best regards,
Alexey Pasumansky,
Agisoft LLC

tazzo

  • Full Member
  • ***
  • Posts: 162
    • View Profile
Re: TIFF/LAB files displayed in Black White only
« Reply #4 on: August 29, 2023, 07:08:35 PM »
Hello,

With LAB there aren't Red, Green and Blue channels, but L*, a* and b* channels. L* is the luminance channel that looks like a grayscale image.

ExifTools is probably not supporting this format, but if you open the files with Affinity Photo or Adobe Photoshop, the right format is shown and the image is displayed.Please see the attached image.

The latest version of LibTIFF library is supporting TIFF/LAB if this is used by Metashape.

LAB is a wider color space than sRGB or other RGB color spaces, so I tried to see if improvements could be done with the texture generation. Sample Images are from a phone so there isn't any great advantage, but my plan is to create TIFF/LAB directly from RAW files and avoid any loss due to the color space.

jedfrechette

  • Full Member
  • ***
  • Posts: 134
  • Lidar Guys
    • View Profile
    • www.lidarguys.com
Re: TIFF/LAB files displayed in Black White only
« Reply #5 on: August 30, 2023, 02:37:55 AM »
If you're just after a color space with a wider gamut, why not try something like ACEScg (or ACES if you absolutely must cover the entire visible spectrum) that is already pretty well supported by Agisoft?
Jed

tazzo

  • Full Member
  • ***
  • Posts: 162
    • View Profile
Re: TIFF/LAB files displayed in Black White only
« Reply #6 on: August 30, 2023, 07:18:56 PM »
LAB is a reference color space AND a document format, means all visible colors are there.
Other Color Spaces are usually smaller and are supported by files only as ICC profiles. ICC profiles have their issues and are not supported by MetaShape.
ACES is not a reference color space, but a wide-gamut colorspaces.

jedfrechette

  • Full Member
  • ***
  • Posts: 134
  • Lidar Guys
    • View Profile
    • www.lidarguys.com
Re: TIFF/LAB files displayed in Black White only
« Reply #7 on: August 31, 2023, 01:51:20 AM »
LAB is a reference color space AND a document format, means all visible colors are there.

What's the benefit of this when you're dealing with images captured by a physical device that can't capture all of those colors anyway?
Jed

tazzo

  • Full Member
  • ***
  • Posts: 162
    • View Profile
Re: TIFF/LAB files displayed in Black White only
« Reply #8 on: August 31, 2023, 04:45:57 PM »
Camera Sensors are able to capture a gamut that is wider than sRGB, Adobe RGB, etc.. so the TIFF/LAB format may have benefits over standard color spaces to post-process the texture.

jedfrechette

  • Full Member
  • ***
  • Posts: 134
  • Lidar Guys
    • View Profile
    • www.lidarguys.com
Re: TIFF/LAB files displayed in Black White only
« Reply #9 on: August 31, 2023, 06:31:14 PM »
ACES AP0 covers the entire CIE 1931 standard-observer spectral locus so theoretically includes all visible colors (and more) but still has all the tooling benefits of using a RGB based color space, including working more or less seamlessly in Metashape. However, even that seems a bit overkill for most photogrammetry processes and the more user friendly ACEScg (AP1) seems like a better working color space if you just want to have a wide gamut scene referred color space.
Jed

tazzo

  • Full Member
  • ***
  • Posts: 162
    • View Profile
Re: TIFF/LAB files displayed in Black White only
« Reply #10 on: September 01, 2023, 01:09:32 AM »
ACES is not well supported by many RAW processors. ProPhoto may be another choice. But if Metashape is not supporting ICC profiles.. this is not working anyway.
We should probably open another feature request for better ICC profiles support.

jedfrechette

  • Full Member
  • ***
  • Posts: 134
  • Lidar Guys
    • View Profile
    • www.lidarguys.com
Re: TIFF/LAB files displayed in Black White only
« Reply #11 on: September 02, 2023, 01:46:36 AM »
ACES is not well supported by many RAW processors.

You mentioned Affinity Photo earlier. Have you tried it? If I remember correctly Affinity's raw development uses libraw, which has had good support for ACES for quite awhile. I know Affinity also has good support for ACES in general via OCIO so that shouldn't be an issue either. For development from camera raw to aces (stored as exrs) we use OpenImageIO, which also uses libraw, and it works well. As long as they expose the appropriate settings, I think any of the other front ends that rely on libraw to do the heavy lifting should also work fine.

With regard to ICC profiles, I presume that was in reference to ProPhoto not ACES?

The good thing about using Metashape and a scene linear ACES based workflow is that even though the display transform inside of Metashape isn't quite right and your images will look a little funny inside the application the underlying pixel values aren't modified. If your source images are in the correct colorspace the resulting texture maps will be generated correctly in the same color space and will render properly once you move them to an application that is color managed. In other words, the fact that Metashape doesn't attempt to do ad-hoc color management (like some other applications do) makes it work well inside of a color-managed pipeline.

If I had one feature request to make in this vein it would actually be for Metashape to adopt OpenImageIO and OpenColorIO for image handling and color management. I imagine that could require a significant development effort depending on how the existing code is structured, but it would provide a number of benefits to users including support for non-RGB images like you're asking for, additional image formats including RAW for many cameras, color management, and the ability for users to do pretty sophisticated image math and compositing within the application.

Jed

tazzo

  • Full Member
  • ***
  • Posts: 162
    • View Profile
Re: TIFF/LAB files displayed in Black White only
« Reply #12 on: September 03, 2023, 08:09:29 PM »
Metashape doesn't understand ICC profiles and any merging/processing operation happening inside is assuming sRGB, so colors won't be optimal even if you assign back the right color profile to the final texture.
Supporting OpenImageIO/OpenColorIO would probably be optimal, but my request was difficulty 1, against this that is difficulty 10. Adding a TIFF/LAB to RGB conversion inside the software is pretty straightforward, if LAB is used internally even easier.

jedfrechette

  • Full Member
  • ***
  • Posts: 134
  • Lidar Guys
    • View Profile
    • www.lidarguys.com
Re: TIFF/LAB files displayed in Black White only
« Reply #13 on: September 05, 2023, 09:40:25 PM »
any merging/processing operation happening inside is assuming sRGB, so colors won't be optimal even if you assign back the right color profile to the final texture.

Do you have a reference for that as it doesn't seem to match the testing I've done?

At least when working with scene-linear floating point images it is entirely possible to generate accurate texture maps without Metashape doing any color management. Admittedly, I haven't tested this with integer image pipelines, so I suppose they could be attempting to do some sort of color management and messing things up. That seems somewhat unlikely to me though, based on what I've seen working with both the applications UI and its Python API.
Jed