From 07ee76e0b41369c61d95c1da35b79a2e33244596 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 2 Dec 2025 15:59:05 +0100 Subject: [PATCH 1/4] feat: Refactor writing color space metadata to unify behavior This adds new functions to get and set colorspaces in a ImageSpace, to make logic between file formats more consistent. * pvt::set_colorspace_srgb and pvt::is_colorspace_srgb * pvt::get_colorspace_rec709_gamma * pvt::get_colorspace_icc_profile * pvt::set_colorspace_cicp and pvt::get_colorspace_cicp This fixes an issue where tga and rla were incorrectly using g22_rec709 and g18_rec709 without _scene suffix, and not handling g24_rec709. There is existing consistency in that some file formats assume an empty oiio:ColorSpace to mean sRGB, and some don't. This inconsistency is preserved. Signed-off-by: Brecht Van Lommel --- src/bmp.imageio/bmpinput.cpp | 5 +- src/dds.imageio/ddsinput.cpp | 21 +++--- src/dpx.imageio/dpxinput.cpp | 4 +- src/dpx.imageio/dpxoutput.cpp | 18 +++-- src/ffmpeg.imageio/ffmpeginput.cpp | 7 +- src/gif.imageio/gifinput.cpp | 4 +- src/heif.imageio/heifinput.cpp | 11 ++- src/heif.imageio/heifoutput.cpp | 9 +-- src/iconvert/iconvert.cpp | 4 +- src/include/OpenImageIO/imageio.h | 1 - src/include/imageio_pvt.h | 38 ++++++++++ src/iv/imageviewer.cpp | 33 ++++----- src/iv/ivgl.cpp | 5 +- src/jpeg.imageio/jpeginput.cpp | 4 +- src/jpeg.imageio/jpegoutput.cpp | 62 ++++++++-------- src/jpeg2000.imageio/jpeg2000input.cpp | 6 +- src/jpeg2000.imageio/jpeg2000output.cpp | 8 +-- src/jpegxl.imageio/jxloutput.cpp | 21 +++--- src/libOpenImageIO/color_ocio.cpp | 92 ++++++++++++++++++++++++ src/libOpenImageIO/exif.cpp | 4 +- src/png.imageio/png_pvt.h | 96 ++++++------------------- src/png.imageio/pnginput.cpp | 19 ++--- src/raw.imageio/rawinput.cpp | 13 ++-- src/rla.imageio/rlaoutput.cpp | 20 ++---- src/targa.imageio/targainput.cpp | 2 +- src/targa.imageio/targaoutput.cpp | 20 ++---- src/tiff.imageio/tiffinput.cpp | 11 +-- src/tiff.imageio/tiffoutput.cpp | 22 ++---- src/webp.imageio/webpinput.cpp | 4 +- src/webp.imageio/webpoutput.cpp | 16 ++--- 30 files changed, 306 insertions(+), 274 deletions(-) diff --git a/src/bmp.imageio/bmpinput.cpp b/src/bmp.imageio/bmpinput.cpp index a39d0b2061..6bd75bc8d1 100644 --- a/src/bmp.imageio/bmpinput.cpp +++ b/src/bmp.imageio/bmpinput.cpp @@ -8,6 +8,8 @@ #include #include +#include "imageio_pvt.h" + #include "bmp_pvt.h" OIIO_PLUGIN_NAMESPACE_BEGIN @@ -262,7 +264,8 @@ BmpInput::open(const std::string& name, ImageSpec& newspec, // Default presumption is that a BMP file is meant to look reasonable on a // display, so assume it's sRGB. This is not really correct -- see the // comments below. - m_spec.attribute("oiio:ColorSpace", "srgb_rec709_scene"); + const bool erase_other_attributes = false; + pvt::set_colorspace_srgb(m_spec, erase_other_attributes); #if 0 if (m_dib_header.size >= WINDOWS_V4 && m_dib_header.cs_type == CSType::CalibratedRGB) { diff --git a/src/dds.imageio/ddsinput.cpp b/src/dds.imageio/ddsinput.cpp index 53f80ed487..ad6a6fddc7 100644 --- a/src/dds.imageio/ddsinput.cpp +++ b/src/dds.imageio/ddsinput.cpp @@ -15,6 +15,8 @@ #include #include +#include "imageio_pvt.h" + #include "dds_pvt.h" #define BCDEC_IMPLEMENTATION #include "bcdec.h" @@ -828,7 +830,7 @@ DDSInput::seek_subimage(int subimage, int miplevel) if (bpp != 0) m_spec.attribute("oiio:BitsPerSample", bpp); - const char* colorspace = nullptr; + bool is_srgb = false; if (m_dds.fmt.fourCC == DDS_4CC_DX10) { switch (m_dx10.dxgiFormat) { @@ -838,18 +840,17 @@ DDSInput::seek_subimage(int subimage, int miplevel) case DDS_FORMAT_BC7_UNORM_SRGB: case DDS_FORMAT_R8G8B8A8_UNORM_SRGB: case DDS_FORMAT_B8G8R8A8_UNORM_SRGB: - case DDS_FORMAT_B8G8R8X8_UNORM_SRGB: - colorspace = "srgb_rec709_scene"; - break; + case DDS_FORMAT_B8G8R8X8_UNORM_SRGB: is_srgb = true; break; } } - // linear color space for HDR-ish images - if (colorspace == nullptr - && (basetype == TypeDesc::HALF || basetype == TypeDesc::FLOAT)) - colorspace = "lin_rec709_scene"; - - m_spec.set_colorspace(colorspace); + if (is_srgb) { + pvt::set_colorspace_srgb(m_spec); + } else if (!is_srgb + && (basetype == TypeDesc::HALF || basetype == TypeDesc::FLOAT)) { + // linear color space for HDR-ish images + m_spec.set_colorspace("lin_rec709_scene"); + } m_spec.default_channel_names(); // Special case: if a 2-channel DDS RG or YA? diff --git a/src/dpx.imageio/dpxinput.cpp b/src/dpx.imageio/dpxinput.cpp index 6675e95ffe..908d290e83 100644 --- a/src/dpx.imageio/dpxinput.cpp +++ b/src/dpx.imageio/dpxinput.cpp @@ -29,6 +29,8 @@ #include #include +#include "imageio_pvt.h" + OIIO_PLUGIN_NAMESPACE_BEGIN @@ -314,7 +316,7 @@ DPXInput::seek_subimage(int subimage, int miplevel) switch (m_dpx.header.Transfer(subimage)) { case dpx::kLinear: m_spec.set_colorspace("lin_rec709_scene"); break; case dpx::kLogarithmic: m_spec.set_colorspace("KodakLog"); break; - case dpx::kITUR709: m_spec.set_colorspace("srgb_rec709_scene"); break; + case dpx::kITUR709: pvt::set_colorspace_srgb(m_spec); break; case dpx::kUserDefined: if (!std::isnan(m_dpx.header.Gamma()) && m_dpx.header.Gamma() != 0) { set_colorspace_rec709_gamma(m_spec, float(m_dpx.header.Gamma())); diff --git a/src/dpx.imageio/dpxoutput.cpp b/src/dpx.imageio/dpxoutput.cpp index 4db1103a3c..0b5b3632a5 100644 --- a/src/dpx.imageio/dpxoutput.cpp +++ b/src/dpx.imageio/dpxoutput.cpp @@ -18,6 +18,8 @@ #include #include +#include "imageio_pvt.h" + OIIO_PLUGIN_NAMESPACE_BEGIN @@ -436,18 +438,14 @@ DPXOutput::prep_subimage(int s, bool allocate) m_desc = get_image_descriptor(); // transfer function - const ColorConfig& colorconfig = ColorConfig::default_colorconfig(); - std::string colorspace = spec_s.get_string_attribute("oiio:ColorSpace", ""); - if (colorconfig.equivalent(colorspace, "lin_rec709_scene")) - m_transfer = dpx::kLinear; - else if (colorconfig.equivalent(colorspace, "srgb_rec709_scene")) + const float gamma = pvt::get_colorspace_rec709_gamma(spec_s); + if (pvt::is_colorspace_srgb(spec_s, false)) m_transfer = dpx::kITUR709; - else if (colorconfig.equivalent(colorspace, "g22_rec709_scene") - || colorconfig.equivalent(colorspace, "g24_rec709_scene") - || colorconfig.equivalent(colorspace, "g18_rec709_scene") - || Strutil::istarts_with(colorspace, "Gamma")) + else if (gamma == 1.0f) + m_transfer = dpx::kLinear; + else if (gamma != 0.0f) m_transfer = dpx::kUserDefined; - else if (colorconfig.equivalent(colorspace, "KodakLog")) + else if (spec_s.get_string_attribute("oiio:ColorSpace") == "KodakLog") m_transfer = dpx::kLogarithmic; else { std::string dpxtransfer = spec_s.get_string_attribute("dpx:Transfer", diff --git a/src/ffmpeg.imageio/ffmpeginput.cpp b/src/ffmpeg.imageio/ffmpeginput.cpp index 26227dd61c..105b22ec1f 100644 --- a/src/ffmpeg.imageio/ffmpeginput.cpp +++ b/src/ffmpeg.imageio/ffmpeginput.cpp @@ -71,6 +71,7 @@ receive_frame(AVCodecContext* avctx, AVFrame* picture, AVPacket* avpkt) +#include "imageio_pvt.h" #include #include #include @@ -549,11 +550,7 @@ FFmpegInput::open(const std::string& name, ImageSpec& spec) = { m_codec_context->color_primaries, m_codec_context->color_trc, m_codec_context->colorspace, m_codec_context->color_range == AVCOL_RANGE_MPEG ? 0 : 1 }; - m_spec.attribute("CICP", TypeDesc(TypeDesc::INT, 4), cicp); - const ColorConfig& colorconfig(ColorConfig::default_colorconfig()); - string_view interop_id = colorconfig.get_color_interop_id(cicp); - if (!interop_id.empty()) - m_spec.attribute("oiio:ColorSpace", interop_id); + pvt::set_colorspace_cicp(m_spec, cicp); m_nsubimages = m_frames; spec = m_spec; diff --git a/src/gif.imageio/gifinput.cpp b/src/gif.imageio/gifinput.cpp index 09a7fd0c61..75ce49cec7 100644 --- a/src/gif.imageio/gifinput.cpp +++ b/src/gif.imageio/gifinput.cpp @@ -12,6 +12,8 @@ #include #include +#include "imageio_pvt.h" + // GIFLIB: // http://giflib.sourceforge.net/ // Format description: @@ -259,7 +261,7 @@ GIFInput::read_subimage_metadata(ImageSpec& newspec) newspec.nchannels = 4; newspec.default_channel_names(); newspec.alpha_channel = 4; - newspec.set_colorspace("srgb_rec709_scene"); + pvt::set_colorspace_srgb(newspec); m_previous_disposal_method = m_disposal_method; m_disposal_method = DISPOSAL_UNSPECIFIED; diff --git a/src/heif.imageio/heifinput.cpp b/src/heif.imageio/heifinput.cpp index 349bcdb1d4..a22f009c5c 100644 --- a/src/heif.imageio/heifinput.cpp +++ b/src/heif.imageio/heifinput.cpp @@ -9,6 +9,8 @@ #include #include +#include "imageio_pvt.h" + #include #define MAKE_LIBHEIF_VERSION(a, b, c, d) \ @@ -273,7 +275,7 @@ HeifInput::seek_subimage(int subimage, int miplevel) if (m_bitdepth > 8) { m_spec.attribute("oiio:BitsPerSample", m_bitdepth); } - m_spec.set_colorspace("srgb_rec709_scene"); + pvt::set_colorspace_srgb(m_spec); #if LIBHEIF_HAVE_VERSION(1, 9, 0) // Read CICP. Have to use the C API to get it from the image handle, @@ -292,12 +294,7 @@ HeifInput::seek_subimage(int subimage, int miplevel) int(nclx->transfer_characteristics), int(nclx->matrix_coefficients), int(nclx->full_range_flag ? 1 : 0) }; - m_spec.attribute("CICP", TypeDesc(TypeDesc::INT, 4), cicp); - const ColorConfig& colorconfig( - ColorConfig::default_colorconfig()); - string_view interop_id = colorconfig.get_color_interop_id(cicp); - if (!interop_id.empty()) - m_spec.attribute("oiio:ColorSpace", interop_id); + pvt::set_colorspace_cicp(m_spec, cicp); } heif_nclx_color_profile_free(nclx); } diff --git a/src/heif.imageio/heifoutput.cpp b/src/heif.imageio/heifoutput.cpp index 9998ab5a5f..6f9977c1fd 100644 --- a/src/heif.imageio/heifoutput.cpp +++ b/src/heif.imageio/heifoutput.cpp @@ -10,6 +10,8 @@ #include #include +#include "imageio_pvt.h" + #include #define MAKE_LIBHEIF_VERSION(a, b, c, d) \ @@ -250,12 +252,7 @@ HeifOutput::close() std::unique_ptr nclx(heif_nclx_color_profile_alloc(), heif_nclx_color_profile_free); - const ColorConfig& colorconfig(ColorConfig::default_colorconfig()); - const ParamValue* p = m_spec.find_attribute("CICP", - TypeDesc(TypeDesc::INT, 4)); - string_view colorspace = m_spec.get_string_attribute("oiio:ColorSpace"); - cspan cicp = (p) ? p->as_cspan() - : colorconfig.get_cicp(colorspace); + cspan cicp = pvt::get_colorspace_cicp(m_spec); if (!cicp.empty()) { nclx->color_primaries = heif_color_primaries(cicp[0]); nclx->transfer_characteristics = heif_transfer_characteristics( diff --git a/src/iconvert/iconvert.cpp b/src/iconvert/iconvert.cpp index e794a8fbf1..6b23b7615a 100644 --- a/src/iconvert/iconvert.cpp +++ b/src/iconvert/iconvert.cpp @@ -18,6 +18,8 @@ #include #include +#include "imageio_pvt.h" + using namespace OIIO; @@ -224,7 +226,7 @@ adjust_spec(ImageInput* in, ImageOutput* out, const ImageSpec& inspec, if (gammaval != 1.0f) outspec.attribute("oiio:Gamma", gammaval); if (sRGB) { - outspec.set_colorspace("srgb_rec709_scene"); + pvt::set_colorspace_srgb(outspec); if (!strcmp(in->format_name(), "jpeg") || outspec.find_attribute("Exif:ColorSpace")) outspec.attribute("Exif:ColorSpace", 1); diff --git a/src/include/OpenImageIO/imageio.h b/src/include/OpenImageIO/imageio.h index e6c1ab0552..b400650c3e 100644 --- a/src/include/OpenImageIO/imageio.h +++ b/src/include/OpenImageIO/imageio.h @@ -4198,7 +4198,6 @@ OIIO_API void set_colorspace(ImageSpec& spec, string_view name); /// @version 3.0 OIIO_API void set_colorspace_rec709_gamma(ImageSpec& spec, float gamma); - /// Are the two named color spaces equivalent, based on the default color /// config in effect? /// diff --git a/src/include/imageio_pvt.h b/src/include/imageio_pvt.h index 273375cd77..2b567ab2e3 100644 --- a/src/include/imageio_pvt.h +++ b/src/include/imageio_pvt.h @@ -127,6 +127,44 @@ parallel_convert_from_float(const float* src, void* dst, size_t nvals, OIIO_API bool check_texture_metadata_sanity(ImageSpec& spec); +/// Set oiio:ColorSpace to the default sRGB colorspace, which may be display +/// or scene referred depending on configuration. +/// +/// If erase_other_attributes is true, other potentially conflicting attributes +/// are erased. +OIIO_API void +set_colorspace_srgb(ImageSpec& spec, bool erase_other_attributes = true); + +/// Returns true if for the purpose of interop, the spec's metadata +/// specifies a color space that should be encoded as sRGB. +/// +/// If default_to_srgb is true, the colorspace will be assumed to +/// be sRGB if no colorspace was specified in the spec. +OIIO_API bool +is_colorspace_srgb(const ImageSpec& spec, bool default_to_srgb = true); + +/// If the spec's metadata specifies a color space with Rec709 primaries and +/// gamma transfer function, return the gamma value. If not, return zero. +OIIO_API float +get_colorspace_rec709_gamma(const ImageSpec& spec); + +// Returns ICC profile from the spec's metadata, either from an ICCProfile +// attribute or from the colorspace if from_colorspace is true. +// Returns an empty vector if not found. +OIIO_API std::vector +get_colorspace_icc_profile(const ImageSpec& spec, bool from_colorspace = true); + +// Set CICP attribute in the spec's metadata, and set oiio:ColorSpace +// along with it if there is a corresponding known colorspace. +OIIO_API void +set_colorspace_cicp(ImageSpec& spec, const int cicp[4]); + +// Returns CICP from the spec's metadata, either from a CICP attribute +// or from the colorspace if from_colorspace is true. +// Returns an empty span if not found. +OIIO_API cspan +get_colorspace_cicp(const ImageSpec& spec, bool from_colorspace = true); + /// Get the timing report from log_time entries. OIIO_API std::string timing_report(); diff --git a/src/iv/imageviewer.cpp b/src/iv/imageviewer.cpp index 12db1aa772..5b3034ac5f 100644 --- a/src/iv/imageviewer.cpp +++ b/src/iv/imageviewer.cpp @@ -44,22 +44,11 @@ #include #include +#include "imageio_pvt.h" #include "ivutils.h" -namespace { - -inline bool -IsSpecSrgb(const ImageSpec& spec) -{ - return equivalent_colorspace(spec.get_string_attribute("oiio:ColorSpace"), - "srgb_rec709_scene"); -} - -} // namespace - - // clang-format off static const char *s_file_filters = "" "Image Files (*.bmp *.cin *.dcm *.dds *.dpx *.fits *.gif *.hdr *.ico *.iff " @@ -1242,7 +1231,8 @@ ImageViewer::loadCurrentImage(int subimage, int miplevel) //std::cerr << "Loading HALF-FLOAT as FLOAT\n"; read_format = TypeDesc::FLOAT; } - if (IsSpecSrgb(image_spec) && !glwin->is_srgb_capable()) { + if (pvt::is_colorspace_srgb(image_spec) + && !glwin->is_srgb_capable()) { // If the image is in sRGB, but OpenGL can't load sRGB textures then // we'll need to do the transformation on the CPU after loading the // image. We (so far) can only do this with UINT8 images, so make @@ -1257,7 +1247,8 @@ ImageViewer::loadCurrentImage(int subimage, int miplevel) read_format = TypeDesc::UINT8; allow_transforms = true; - if (IsSpecSrgb(image_spec) && !glwin->is_srgb_capable()) + if (pvt::is_colorspace_srgb(image_spec) + && !glwin->is_srgb_capable()) srgb_transform = true; } @@ -1443,7 +1434,7 @@ ImageViewer::exposureMinusOneTenthStop() img->exposure(img->exposure() - 0.1); if (!glwin->is_glsl_capable()) { bool srgb_transform = (!glwin->is_srgb_capable() - && IsSpecSrgb(img->spec())); + && pvt::is_colorspace_srgb(img->spec())); img->pixel_transform(srgb_transform, (int)current_color_mode(), current_channel()); displayCurrentImage(); @@ -1462,7 +1453,7 @@ ImageViewer::exposureMinusOneHalfStop() img->exposure(img->exposure() - 0.5); if (!glwin->is_glsl_capable()) { bool srgb_transform = (!glwin->is_srgb_capable() - && IsSpecSrgb(img->spec())); + && pvt::is_colorspace_srgb(img->spec())); img->pixel_transform(srgb_transform, (int)current_color_mode(), current_channel()); displayCurrentImage(); @@ -1481,7 +1472,7 @@ ImageViewer::exposurePlusOneTenthStop() img->exposure(img->exposure() + 0.1); if (!glwin->is_glsl_capable()) { bool srgb_transform = (!glwin->is_srgb_capable() - && IsSpecSrgb(img->spec())); + && pvt::is_colorspace_srgb(img->spec())); img->pixel_transform(srgb_transform, (int)current_color_mode(), current_channel()); displayCurrentImage(); @@ -1500,7 +1491,7 @@ ImageViewer::exposurePlusOneHalfStop() img->exposure(img->exposure() + 0.5); if (!glwin->is_glsl_capable()) { bool srgb_transform = (!glwin->is_srgb_capable() - && IsSpecSrgb(img->spec())); + && pvt::is_colorspace_srgb(img->spec())); img->pixel_transform(srgb_transform, (int)current_color_mode(), current_channel()); displayCurrentImage(); @@ -1520,7 +1511,7 @@ ImageViewer::gammaMinus() img->gamma(img->gamma() - 0.05); if (!glwin->is_glsl_capable()) { bool srgb_transform = (!glwin->is_srgb_capable() - && IsSpecSrgb(img->spec())); + && pvt::is_colorspace_srgb(img->spec())); img->pixel_transform(srgb_transform, (int)current_color_mode(), current_channel()); displayCurrentImage(); @@ -1539,7 +1530,7 @@ ImageViewer::gammaPlus() img->gamma(img->gamma() + 0.05); if (!glwin->is_glsl_capable()) { bool srgb_transform = (!glwin->is_srgb_capable() - && IsSpecSrgb(img->spec())); + && pvt::is_colorspace_srgb(img->spec())); img->pixel_transform(srgb_transform, (int)current_color_mode(), current_channel()); displayCurrentImage(); @@ -1572,7 +1563,7 @@ ImageViewer::viewChannel(int c, COLOR_MODE colormode) IvImage* img = cur(); if (img) { bool srgb_transform = (!glwin->is_srgb_capable() - && IsSpecSrgb(img->spec())); + && pvt::is_colorspace_srgb(img->spec())); img->pixel_transform(srgb_transform, (int)colormode, c); } } else { diff --git a/src/iv/ivgl.cpp b/src/iv/ivgl.cpp index 2d773d674c..e8f95b69ee 100644 --- a/src/iv/ivgl.cpp +++ b/src/iv/ivgl.cpp @@ -18,6 +18,7 @@ # include #endif +#include "imageio_pvt.h" #include "ivutils.h" #include #include @@ -2198,9 +2199,7 @@ IvGL::typespec_to_opengl(const ImageSpec& spec, int nchannels, GLenum& gltype, break; } - bool issrgb - = equivalent_colorspace(spec.get_string_attribute("oiio:ColorSpace"), - "srgb_rec709_scene"); + bool issrgb = pvt::is_colorspace_srgb(spec); glinternalformat = nchannels; if (nchannels == 1) { diff --git a/src/jpeg.imageio/jpeginput.cpp b/src/jpeg.imageio/jpeginput.cpp index 47795f5379..c5250a0eef 100644 --- a/src/jpeg.imageio/jpeginput.cpp +++ b/src/jpeg.imageio/jpeginput.cpp @@ -12,6 +12,8 @@ #include #include +#include "imageio_pvt.h" + #include "jpeg_pvt.h" OIIO_PLUGIN_NAMESPACE_BEGIN @@ -258,7 +260,7 @@ JpgInput::open(const std::string& name, ImageSpec& newspec) return false; // Assume JPEG is in sRGB unless the Exif or XMP tags say otherwise. - m_spec.set_colorspace("srgb_rec709_scene"); + pvt::set_colorspace_srgb(m_spec); if (m_cinfo.jpeg_color_space == JCS_CMYK) m_spec.attribute("jpeg:ColorSpace", "CMYK"); diff --git a/src/jpeg.imageio/jpegoutput.cpp b/src/jpeg.imageio/jpegoutput.cpp index f6058deb25..0e87bd00f9 100644 --- a/src/jpeg.imageio/jpegoutput.cpp +++ b/src/jpeg.imageio/jpegoutput.cpp @@ -12,6 +12,8 @@ #include #include +#include "imageio_pvt.h" + #include "jpeg_pvt.h" OIIO_PLUGIN_NAMESPACE_BEGIN @@ -268,8 +270,7 @@ JpgOutput::open(const std::string& name, const ImageSpec& newspec, } } - if (equivalent_colorspace(m_spec.get_string_attribute("oiio:ColorSpace"), - "srgb_rec709_scene")) + if (pvt::is_colorspace_srgb(m_spec, false)) m_spec.attribute("Exif:ColorSpace", 1); // Write EXIF info @@ -320,37 +321,32 @@ JpgOutput::open(const std::string& name, const ImageSpec& newspec, m_spec.set_format(TypeDesc::UINT8); // JPG is only 8 bit // Write ICC profile, if we have anything - if (auto icc_profile_parameter = m_spec.find_attribute(ICC_PROFILE_ATTR)) { - cspan icc_profile((unsigned char*) - icc_profile_parameter->data(), - icc_profile_parameter->type().size()); - if (icc_profile.size() && icc_profile.data()) { - /* Calculate the number of markers we'll need, rounding up of course */ - size_t num_markers = icc_profile.size() / MAX_DATA_BYTES_IN_MARKER; - if (num_markers * MAX_DATA_BYTES_IN_MARKER - != std::size(icc_profile)) - num_markers++; - int curr_marker = 1; /* per spec, count starts at 1*/ - std::vector profile(MAX_DATA_BYTES_IN_MARKER - + ICC_HEADER_SIZE); - size_t icc_profile_length = icc_profile.size(); - while (icc_profile_length > 0) { - // length of profile to put in this marker - size_t length = std::min(icc_profile_length, - size_t(MAX_DATA_BYTES_IN_MARKER)); - icc_profile_length -= length; - // Write the JPEG marker header (APP2 code and marker length) - strcpy((char*)profile.data(), "ICC_PROFILE"); // NOSONAR - profile[11] = 0; - profile[12] = curr_marker; - profile[13] = (JOCTET)num_markers; - OIIO_ASSERT(profile.size() >= ICC_HEADER_SIZE + length); - spancpy(make_span(profile), ICC_HEADER_SIZE, icc_profile, - length * (curr_marker - 1), length); - jpeg_write_marker(&m_cinfo, JPEG_APP0 + 2, profile.data(), - ICC_HEADER_SIZE + length); - curr_marker++; - } + std::vector icc_profile = pvt::get_colorspace_icc_profile(m_spec); + if (icc_profile.size()) { + /* Calculate the number of markers we'll need, rounding up of course */ + size_t num_markers = icc_profile.size() / MAX_DATA_BYTES_IN_MARKER; + if (num_markers * MAX_DATA_BYTES_IN_MARKER != std::size(icc_profile)) + num_markers++; + int curr_marker = 1; /* per spec, count starts at 1*/ + std::vector profile(MAX_DATA_BYTES_IN_MARKER + ICC_HEADER_SIZE); + size_t icc_profile_length = icc_profile.size(); + while (icc_profile_length > 0) { + // length of profile to put in this marker + size_t length = std::min(icc_profile_length, + size_t(MAX_DATA_BYTES_IN_MARKER)); + icc_profile_length -= length; + // Write the JPEG marker header (APP2 code and marker length) + strcpy((char*)profile.data(), "ICC_PROFILE"); // NOSONAR + profile[11] = 0; + profile[12] = curr_marker; + profile[13] = (JOCTET)num_markers; + OIIO_ASSERT(profile.size() >= ICC_HEADER_SIZE + length); + spancpy(make_span(profile), ICC_HEADER_SIZE, + cspan(icc_profile), length * (curr_marker - 1), + length); + jpeg_write_marker(&m_cinfo, JPEG_APP0 + 2, profile.data(), + ICC_HEADER_SIZE + length); + curr_marker++; } } diff --git a/src/jpeg2000.imageio/jpeg2000input.cpp b/src/jpeg2000.imageio/jpeg2000input.cpp index 871c295c4e..3097b97968 100644 --- a/src/jpeg2000.imageio/jpeg2000input.cpp +++ b/src/jpeg2000.imageio/jpeg2000input.cpp @@ -15,6 +15,8 @@ #include #include +#include "imageio_pvt.h" + #ifdef USE_OPENJPH # include # include @@ -369,7 +371,7 @@ Jpeg2000Input::ojph_read_header() m_spec = ImageSpec(w, h, ch, dtype); m_spec.default_channel_names(); m_spec.attribute("oiio:BitsPerSample", siz.get_bit_depth(0)); - m_spec.set_colorspace("srgb_rec709_scene"); + pvt::set_colorspace_srgb(m_spec); return true; } @@ -617,7 +619,7 @@ Jpeg2000Input::open(const std::string& name, ImageSpec& p_spec) m_spec.full_height = m_image->y1; m_spec.attribute("oiio:BitsPerSample", maxPrecision); - m_spec.set_colorspace("srgb_rec709_scene"); + pvt::set_colorspace_srgb(m_spec); if (m_image->icc_profile_len && m_image->icc_profile_buf) { m_spec.attribute("ICCProfile", diff --git a/src/jpeg2000.imageio/jpeg2000output.cpp b/src/jpeg2000.imageio/jpeg2000output.cpp index 1c35491fb0..7a2551973d 100644 --- a/src/jpeg2000.imageio/jpeg2000output.cpp +++ b/src/jpeg2000.imageio/jpeg2000output.cpp @@ -481,10 +481,10 @@ Jpeg2000Output::create_jpeg2000_image() // someboody comes along that desperately needs JPEG2000 and ICC // profiles, maybe they will be motivated enough to track down the // problem. - const ParamValue *icc = m_spec.find_attribute ("ICCProfile"); - if (icc && icc->type().basetype == TypeDesc::UINT8 && icc->type().arraylen > 0) { - m_image->icc_profile_len = icc->type().arraylen; - m_image->icc_profile_buf = (unsigned char *) icc->data(); + std::vector icc_profile = get_colorspace_icc_profile(m_spec); + if (icc_profile.size()) { + m_image->icc_profile_len = icc_profile.size(); + m_image->icc_profile_buf = (unsigned char *) icc_profile.data(); } #endif diff --git a/src/jpegxl.imageio/jxloutput.cpp b/src/jpegxl.imageio/jxloutput.cpp index de82467fa7..f61721eb3f 100644 --- a/src/jpegxl.imageio/jxloutput.cpp +++ b/src/jpegxl.imageio/jxloutput.cpp @@ -3,6 +3,7 @@ // https://github.com/AcademySoftwareFoundation/OpenImageIO #include +#include #include #include @@ -11,6 +12,8 @@ #include #include +#include "imageio_pvt.h" + #include #include #include @@ -539,18 +542,12 @@ JxlOutput::save_image(const void* data) } // Write the ICC profile, if available - const ParamValue* icc_profile_parameter = m_spec.find_attribute( - "ICCProfile"); - if (icc_profile_parameter != nullptr) { - unsigned char* icc_profile - = (unsigned char*)icc_profile_parameter->data(); - uint32_t length = icc_profile_parameter->type().size(); - if (icc_profile && length) { - if (JXL_ENC_SUCCESS - != JxlEncoderSetICCProfile(m_encoder.get(), icc_profile, - length)) { - errorfmt("JxlEncoderSetICCProfile failed\n"); - } + std::vector icc_profile = pvt::get_colorspace_icc_profile(m_spec); + if (icc_profile.size()) { + if (JXL_ENC_SUCCESS + != JxlEncoderSetICCProfile(m_encoder.get(), icc_profile.data(), + icc_profile.size())) { + errorfmt("JxlEncoderSetICCProfile failed\n"); } } diff --git a/src/libOpenImageIO/color_ocio.cpp b/src/libOpenImageIO/color_ocio.cpp index a365cd9b48..3446b31e7e 100644 --- a/src/libOpenImageIO/color_ocio.cpp +++ b/src/libOpenImageIO/color_ocio.cpp @@ -2835,5 +2835,97 @@ set_colorspace_rec709_gamma(ImageSpec& spec, float gamma) ColorConfig::default_colorconfig().set_colorspace_rec709_gamma(spec, gamma); } +OIIO_NAMESPACE_3_1_END + +OIIO_NAMESPACE_BEGIN + +void +pvt::set_colorspace_srgb(ImageSpec& spec, bool erase_other_attributes) +{ + if (erase_other_attributes) { + spec.set_colorspace("srgb_rec709_scene"); + } else { + spec.attribute("oiio:ColorSpace", "srgb_rec709_scene"); + } +} + +bool +pvt::is_colorspace_srgb(const ImageSpec& spec, bool default_to_srgb) +{ + string_view colorspace = spec.get_string_attribute("oiio:ColorSpace"); + if (default_to_srgb && colorspace.empty()) { + return true; + } + + const ColorConfig& colorconfig(ColorConfig::default_colorconfig()); + string_view interop_id = colorconfig.get_color_interop_id(colorspace); + return interop_id == "srgb_rec709_scene"; +} + +float +pvt::get_colorspace_rec709_gamma(const ImageSpec& spec) +{ + const ColorConfig& colorconfig(ColorConfig::default_colorconfig()); + string_view colorspace = spec.get_string_attribute("oiio:ColorSpace"); + string_view interop_id = colorconfig.get_color_interop_id(colorspace); + + // scene_linear is not guaranteed to be Rec709, here for back compatibility + if (colorconfig.equivalent(colorspace, "linear") + || colorconfig.equivalent(colorspace, "scene_linear") + || interop_id == "lin_rec709_scene") + return 1.0f; + else if (interop_id == "g22_rec709_scene") + return 2.2f; + // Note g24_rec709_scene is not a standard interop ID + else if (colorconfig.equivalent(colorspace, "g24_rec709_scene")) + return 2.4f; + else if (interop_id == "g18_rec709_scene") + return 1.8f; + // Back compatible, this is DEPRECATED(3.1) + else if (Strutil::istarts_with(colorspace, "Gamma")) { + Strutil::parse_word(colorspace); + float g = Strutil::from_string(colorspace); + if (g >= 0.01f && g <= 10.0f /* sanity check */) + return g; + } + + // Obsolete "oiio:Gamma" attrib for back compatibility + return spec.get_float_attribute("oiio:Gamma", 0.0f); +} + +std::vector +pvt::get_colorspace_icc_profile(const ImageSpec& spec, bool /*from_colorspace*/) +{ + std::vector icc_profile; + const ParamValue* p = spec.find_attribute("ICCProfile"); + if (p) { + cspan icc_profile_span = p->as_cspan(); + icc_profile.assign(icc_profile_span.begin(), icc_profile_span.end()); + } + return icc_profile; +} + +void +pvt::set_colorspace_cicp(ImageSpec& spec, const int cicp[4]) +{ + spec.attribute("CICP", TypeDesc(TypeDesc::INT, 4), cicp); + const ColorConfig& colorconfig(ColorConfig::default_colorconfig()); + string_view interop_id = colorconfig.get_color_interop_id(cicp); + if (!interop_id.empty()) + spec.attribute("oiio:ColorSpace", interop_id); +} + +cspan +pvt::get_colorspace_cicp(const ImageSpec& spec, bool from_colorspace) +{ + const ParamValue* p = spec.find_attribute("CICP", + TypeDesc(TypeDesc::INT, 4)); + if (p) + return p->as_cspan(); + if (!from_colorspace) + return cspan(); + const ColorConfig& colorconfig(ColorConfig::default_colorconfig()); + return colorconfig.get_cicp(spec.get_string_attribute("oiio:ColorSpace")); +} OIIO_NAMESPACE_END diff --git a/src/libOpenImageIO/exif.cpp b/src/libOpenImageIO/exif.cpp index ab95d881ef..288a189235 100644 --- a/src/libOpenImageIO/exif.cpp +++ b/src/libOpenImageIO/exif.cpp @@ -18,6 +18,8 @@ #include #include +#include "imageio_pvt.h" + #include "exif.h" OIIO_NAMESPACE_BEGIN @@ -1255,7 +1257,7 @@ decode_exif(cspan exif, ImageSpec& spec) // Exif spec says that anything other than 0xffff==uncalibrated // should be interpreted to be sRGB. if (cs != 0xffff) - spec.set_colorspace("srgb_rec709_scene"); + OIIO::pvt::set_colorspace_srgb(spec); } // Look for a maker note offset, now that we have seen all the metadata diff --git a/src/png.imageio/png_pvt.h b/src/png.imageio/png_pvt.h index 3c103eb836..67d14e56cd 100644 --- a/src/png.imageio/png_pvt.h +++ b/src/png.imageio/png_pvt.h @@ -18,6 +18,7 @@ #include #include +#include "imageio_pvt.h" #define OIIO_LIBPNG_VERSION \ (PNG_LIBPNG_VER_MAJOR * 10000 + PNG_LIBPNG_VER_MINOR * 100 \ @@ -40,7 +41,6 @@ For further information see the following mailing list threads: OIIO_PLUGIN_NAMESPACE_BEGIN #define ICC_PROFILE_ATTR "ICCProfile" -#define CICP_ATTR "CICP" namespace PNG_pvt { @@ -224,7 +224,8 @@ read_info(png_structp& sp, png_infop& ip, int& bit_depth, int& color_type, int srgb_intent; double gamma = 0.0; if (png_get_sRGB(sp, ip, &srgb_intent)) { - spec.attribute("oiio:ColorSpace", "srgb_rec709_scene"); + const bool erase_other_attributes = false; + pvt::set_colorspace_srgb(spec, erase_other_attributes); } else if (png_get_gAMA(sp, ip, &gamma) && gamma > 0.0) { // Round gamma to the nearest hundredth to prevent stupid // precision choices and make it easier for apps to make @@ -235,7 +236,8 @@ read_info(png_structp& sp, png_infop& ip, int& bit_depth, int& color_type, set_colorspace_rec709_gamma(spec, g); } else { // If there's no info at all, assume sRGB. - spec.attribute("oiio:ColorSpace", "srgb_rec709_scene"); + const bool erase_other_attributes = false; + pvt::set_colorspace_srgb(spec, erase_other_attributes); } if (png_get_valid(sp, ip, PNG_INFO_iCCP)) { @@ -331,11 +333,7 @@ read_info(png_structp& sp, png_infop& ip, int& bit_depth, int& color_type, png_byte pri = 0, trc = 0, mtx = 0, vfr = 0; if (png_get_cICP(sp, ip, &pri, &trc, &mtx, &vfr)) { const int cicp[4] = { pri, trc, mtx, vfr }; - spec.attribute(CICP_ATTR, TypeDesc(TypeDesc::INT, 4), cicp); - const ColorConfig& colorconfig(ColorConfig::default_colorconfig()); - string_view interop_id = colorconfig.get_color_interop_id(cicp); - if (!interop_id.empty()) - spec.attribute("oiio:ColorSpace", interop_id); + pvt::set_colorspace_cicp(spec, cicp); } } #endif @@ -609,78 +607,34 @@ write_info(png_structp& sp, png_infop& ip, int& color_type, ImageSpec& spec, convert_alpha = spec.alpha_channel != -1 && !spec.get_int_attribute("oiio:UnassociatedAlpha", 0); - string_view colorspace = spec.get_string_attribute("oiio:ColorSpace", - "srgb_rec709_scene"); - const ColorConfig& colorconfig(ColorConfig::default_colorconfig()); OIIO_MAYBE_UNUSED bool wrote_colorspace = false; srgb = false; - if (colorconfig.equivalent(colorspace, "srgb_rec709_scene")) { - srgb = true; + if (pvt::is_colorspace_srgb(spec)) { gamma = 1.0f; - } else if (colorconfig.equivalent(colorspace, "g22_rec709_scene")) { - gamma = 2.2f; - } else if (colorconfig.equivalent(colorspace, "g24_rec709_scene")) { - gamma = 2.4f; - } else if (colorconfig.equivalent(colorspace, "g18_rec709_scene")) { - gamma = 1.8f; - } else { - gamma = spec.get_float_attribute("oiio:Gamma", 1.0f); - // obsolete "oiio:Gamma" attrib for back compatibility - } - - if (colorconfig.equivalent(colorspace, "scene_linear") - || colorconfig.equivalent(colorspace, "lin_rec709_scene")) { - if (setjmp(png_jmpbuf(sp))) // NOLINT(cert-err52-cpp) - return "Could not set PNG gAMA chunk"; - png_set_gAMA(sp, ip, 1.0); - srgb = false; - wrote_colorspace = true; - } else if (Strutil::istarts_with(colorspace, "Gamma")) { - // Back compatible, this is DEPRECATED(3.1) - Strutil::parse_word(colorspace); - float g = Strutil::from_string(colorspace); - if (g >= 0.01f && g <= 10.0f /* sanity check */) - gamma = g; - if (setjmp(png_jmpbuf(sp))) // NOLINT(cert-err52-cpp) - return "Could not set PNG gAMA chunk"; - png_set_gAMA(sp, ip, 1.0f / gamma); - srgb = false; - wrote_colorspace = true; - } else if (colorconfig.equivalent(colorspace, "g22_rec709_scene")) { - gamma = 2.2f; - if (setjmp(png_jmpbuf(sp))) // NOLINT(cert-err52-cpp) - return "Could not set PNG gAMA chunk"; - png_set_gAMA(sp, ip, 1.0f / gamma); - srgb = false; - wrote_colorspace = true; - } else if (colorconfig.equivalent(colorspace, "g18_rec709_scene")) { - gamma = 1.8f; - if (setjmp(png_jmpbuf(sp))) // NOLINT(cert-err52-cpp) - return "Could not set PNG gAMA chunk"; - png_set_gAMA(sp, ip, 1.0f / gamma); - srgb = false; - wrote_colorspace = true; - } else if (colorconfig.equivalent(colorspace, "srgb_rec709_scene")) { + srgb = true; if (setjmp(png_jmpbuf(sp))) // NOLINT(cert-err52-cpp) return "Could not set PNG gAMA and cHRM chunk"; png_set_sRGB_gAMA_and_cHRM(sp, ip, PNG_sRGB_INTENT_ABSOLUTE); - srgb = true; wrote_colorspace = true; + } else { + gamma = pvt::get_colorspace_rec709_gamma(spec); + if (gamma != 0.0f) { + if (setjmp(png_jmpbuf(sp))) // NOLINT(cert-err52-cpp) + return "Could not set PNG gAMA chunk"; + png_set_gAMA(sp, ip, 1.0 / gamma); + srgb = false; + wrote_colorspace = true; + } } // Write ICC profile, if we have anything - const ParamValue* icc_profile_parameter = spec.find_attribute( - ICC_PROFILE_ATTR); - if (icc_profile_parameter != nullptr) { - unsigned int length = icc_profile_parameter->type().size(); + std::vector icc_profile = pvt::get_colorspace_icc_profile(spec); + if (icc_profile.size()) { if (setjmp(png_jmpbuf(sp))) // NOLINT(cert-err52-cpp) return "Could not set PNG iCCP chunk"; - unsigned char* icc_profile - = (unsigned char*)icc_profile_parameter->data(); - if (icc_profile && length) { - png_set_iCCP(sp, ip, "Embedded Profile", 0, icc_profile, length); - wrote_colorspace = true; - } + png_set_iCCP(sp, ip, "Embedded Profile", 0, icc_profile.data(), + icc_profile.size()); + wrote_colorspace = true; } if (false && !spec.find_attribute("DateTime")) { @@ -738,11 +692,7 @@ write_info(png_structp& sp, png_infop& ip, int& color_type, ImageSpec& spec, #ifdef PNG_cICP_SUPPORTED // Only automatically determine CICP from oiio::ColorSpace if we didn't // write colorspace metadata yet. - const ParamValue* p = spec.find_attribute(CICP_ATTR, - TypeDesc(TypeDesc::INT, 4)); - cspan cicp = (p) ? p->as_cspan() - : (!wrote_colorspace) ? colorconfig.get_cicp(colorspace) - : cspan(); + cspan cicp = pvt::get_colorspace_cicp(spec, !wrote_colorspace); if (!cicp.empty()) { png_byte vals[4]; for (int i = 0; i < 4; ++i) diff --git a/src/png.imageio/pnginput.cpp b/src/png.imageio/pnginput.cpp index 0b875e6210..faccf3495e 100644 --- a/src/png.imageio/pnginput.cpp +++ b/src/png.imageio/pnginput.cpp @@ -177,22 +177,15 @@ PNGInput::open(const std::string& name, ImageSpec& newspec) return false; } - string_view colorspace = m_spec.get_string_attribute("oiio:ColorSpace", - "srgb_rec709_scene"); - const ColorConfig& colorconfig(ColorConfig::default_colorconfig()); - m_srgb = false; - if (colorconfig.equivalent(colorspace, "srgb_rec709_scene")) { + if (pvt::is_colorspace_srgb(m_spec)) { m_srgb = true; m_gamma = 1.0f; - } else if (colorconfig.equivalent(colorspace, "g22_rec709_scene")) { - m_gamma = 2.2f; - } else if (colorconfig.equivalent(colorspace, "g24_rec709_scene")) { - m_gamma = 2.4f; - } else if (colorconfig.equivalent(colorspace, "g18_rec709_scene")) { - m_gamma = 1.8f; } else { - m_gamma = m_spec.get_float_attribute("oiio:Gamma", 1.0f); - // obsolete "oiio:Gamma" attrib for back compatibility + m_srgb = false; + m_gamma = pvt::get_colorspace_rec709_gamma(m_spec); + if (m_gamma == 0.0f) { + m_gamma = 1.0f; + } } newspec = spec(); diff --git a/src/raw.imageio/rawinput.cpp b/src/raw.imageio/rawinput.cpp index 8fa7c6bc71..513f1f6fcf 100644 --- a/src/raw.imageio/rawinput.cpp +++ b/src/raw.imageio/rawinput.cpp @@ -19,6 +19,8 @@ #include #include +#include "imageio_pvt.h" + #if OIIO_GNUC_VERSION || OIIO_CLANG_VERSION // fix warnings in libraw headers: use of auto_ptr # pragma GCC diagnostic ignored "-Wdeprecated-declarations" @@ -569,14 +571,13 @@ RawInput::open_raw(bool unpack, bool process, const std::string& name, // request for "sRGB-linear" will give you sRGB primaries with a linear // response. const ColorConfig& colorconfig(ColorConfig::default_colorconfig()); - std::string cs = config.get_string_attribute("raw:ColorSpace", - "srgb_rec709_scene"); + std::string cs = config.get_string_attribute("raw:ColorSpace"); if (Strutil::iequals(cs, "raw")) { // Values straight from the chip m_processor->imgdata.params.output_color = 0; m_processor->imgdata.params.gamm[0] = 1.0; m_processor->imgdata.params.gamm[1] = 1.0; - } else if (colorconfig.equivalent(cs, "srgb_rec709_scene") + } else if (cs.empty() || colorconfig.equivalent(cs, "srgb_rec709_scene") || Strutil::iequals(cs, "sRGB") /* Necessary? */) { // Request explicit sRGB, including usual sRGB response m_processor->imgdata.params.output_color = 1; @@ -643,7 +644,11 @@ RawInput::open_raw(bool unpack, bool process, const std::string& name, errorfmt("raw:ColorSpace set to unknown value \"{}\"", cs); return false; } - m_spec.set_colorspace(cs); + if (cs.empty()) { + pvt::set_colorspace_srgb(m_spec); + } else { + m_spec.set_colorspace(cs); + } // Exposure adjustment float exposure = config.get_float_attribute("raw:Exposure", -1.0f); diff --git a/src/rla.imageio/rlaoutput.cpp b/src/rla.imageio/rlaoutput.cpp index fec2736d51..c19fc8e39a 100644 --- a/src/rla.imageio/rlaoutput.cpp +++ b/src/rla.imageio/rlaoutput.cpp @@ -15,6 +15,8 @@ #include #include +#include "imageio_pvt.h" + #include "rla_pvt.h" @@ -260,21 +262,9 @@ RLAOutput::open(const std::string& name, const ImageSpec& userspec, // << m_rla.NumOfMatteChannels << " z " << m_rla.NumOfAuxChannels << "\n"; m_rla.Revision = 0xFFFE; - const ColorConfig& colorconfig = ColorConfig::default_colorconfig(); - string_view colorspace = m_spec.get_string_attribute("oiio:ColorSpace"); - if (colorconfig.equivalent(colorspace, "linear") - || colorconfig.equivalent(colorspace, "scene_linear")) - Strutil::safe_strcpy(m_rla.Gamma, "1.0", sizeof(m_rla.Gamma)); - else if (colorconfig.equivalent(colorspace, "g22_rec709")) - Strutil::safe_strcpy(m_rla.Gamma, "2.2", sizeof(m_rla.Gamma)); - else if (colorconfig.equivalent(colorspace, "g18_rec709")) - Strutil::safe_strcpy(m_rla.Gamma, "1.8", sizeof(m_rla.Gamma)); - else if (Strutil::istarts_with(colorspace, "Gamma")) { - Strutil::parse_word(colorspace); - float g = Strutil::from_string(colorspace); - if (!(g >= 0.01f && g <= 10.0f /* sanity check */)) - g = m_spec.get_float_attribute("oiio:Gamma", 1.f); - safe_format_to(m_rla.Gamma, "{:.10}", g); + const float gamma = pvt::get_colorspace_rec709_gamma(m_spec); + if (gamma != 0.0f) { + safe_format_to(m_rla.Gamma, "{:.5g}", gamma); } const ParamValue* p; diff --git a/src/targa.imageio/targainput.cpp b/src/targa.imageio/targainput.cpp index 984f772ffa..1fc25e1e2f 100644 --- a/src/targa.imageio/targainput.cpp +++ b/src/targa.imageio/targainput.cpp @@ -524,7 +524,7 @@ TGAInput::get_thumbnail(ImageBuf& thumb, int subimage) // the thumbnail is in the same format as the main image but // uncompressed. ImageSpec thumbspec(res[0], res[1], m_spec.nchannels, TypeUInt8); - thumbspec.set_colorspace("srgb_rec709_scene"); + pvt::set_colorspace_srgb(thumbspec); thumb.reset(thumbspec); int bytespp = (m_tga.bpp == 15) ? 2 : (m_tga.bpp / 8); int palbytespp = (m_tga.cmap_size == 15) ? 2 : (m_tga.cmap_size / 8); diff --git a/src/targa.imageio/targaoutput.cpp b/src/targa.imageio/targaoutput.cpp index b580da9907..11a1db4b7d 100644 --- a/src/targa.imageio/targaoutput.cpp +++ b/src/targa.imageio/targaoutput.cpp @@ -15,6 +15,8 @@ #include #include +#include "imageio_pvt.h" + #include "targa_pvt.h" OIIO_PLUGIN_NAMESPACE_BEGIN @@ -353,22 +355,8 @@ TGAOutput::write_tga20_data_fields() } // gamma -- two shorts, giving a ratio - const ColorConfig& colorconfig = ColorConfig::default_colorconfig(); - string_view colorspace = m_spec.get_string_attribute("oiio:ColorSpace"); - if (colorconfig.equivalent(colorspace, "g22_rec709")) { - m_gamma = 2.2f; - write(uint16_t(m_gamma * 10.0f)); - write(uint16_t(10)); - } else if (colorconfig.equivalent(colorspace, "g18_rec709")) { - m_gamma = 1.8f; - write(uint16_t(m_gamma * 10.0f)); - write(uint16_t(10)); - } else if (Strutil::istarts_with(colorspace, "Gamma")) { - // Extract gamma value from color space, if it's there - Strutil::parse_word(colorspace); - float g = Strutil::from_string(colorspace); - if (g >= 0.01f && g <= 10.0f /* sanity check */) - m_gamma = g; + const float gamma = pvt::get_colorspace_rec709_gamma(m_spec); + if (gamma != 0.0f) { // FIXME: invent a smarter way to convert to a vulgar fraction? // NOTE: the spec states that only 1 decimal place of precision // is needed, thus the expansion by 10 diff --git a/src/tiff.imageio/tiffinput.cpp b/src/tiff.imageio/tiffinput.cpp index ac360d2c32..bda9e2c6bb 100644 --- a/src/tiff.imageio/tiffinput.cpp +++ b/src/tiff.imageio/tiffinput.cpp @@ -1313,11 +1313,12 @@ TIFFInput::readspec(bool read_meta) } // Exif spec says that anything other than 0xffff==uncalibrated // should be interpreted to be sRGB. - if (m_spec.get_int_attribute("Exif:ColorSpace") != 0xffff) - m_spec.attribute("oiio:ColorSpace", "srgb_rec709_scene"); - // NOTE: We must set "oiio:ColorSpace" explicitly, not call - // set_colorspace, or it will erase several other TIFF attribs we - // need to preserve. + if (m_spec.get_int_attribute("Exif:ColorSpace") != 0xffff) { + // NOTE: We do not erase other attributes as we want to + // preserve TIFF attributes. + const bool erase_other_attributes = false; + pvt::set_colorspace_srgb(m_spec, erase_other_attributes); + } } // TIFFReadEXIFDirectory seems to do something to the internal state // that requires a TIFFSetDirectory to set things straight again. diff --git a/src/tiff.imageio/tiffoutput.cpp b/src/tiff.imageio/tiffoutput.cpp index efac72345b..cfe690964d 100644 --- a/src/tiff.imageio/tiffoutput.cpp +++ b/src/tiff.imageio/tiffoutput.cpp @@ -393,9 +393,6 @@ TIFFOutput::supports(string_view feature) const } -#define ICC_PROFILE_ATTR "ICCProfile" - - // Do all elements of vector d have value v? template inline bool @@ -871,18 +868,13 @@ TIFFOutput::open(const std::string& name, const ImageSpec& userspec, } // Write ICC profile, if we have anything - const ParamValue* icc_profile_parameter = m_spec.find_attribute( - ICC_PROFILE_ATTR); - if (icc_profile_parameter != NULL) { - unsigned char* icc_profile - = (unsigned char*)icc_profile_parameter->data(); - uint32_t length = icc_profile_parameter->type().size(); - if (icc_profile && length) - TIFFSetField(m_tif, TIFFTAG_ICCPROFILE, length, icc_profile); - } - - if (equivalent_colorspace(m_spec.get_string_attribute("oiio:ColorSpace"), - "srgb_rec709_scene")) + std::vector icc_profile = pvt::get_colorspace_icc_profile(m_spec); + if (icc_profile.size()) { + TIFFSetField(m_tif, TIFFTAG_ICCPROFILE, icc_profile.size(), + icc_profile.data()); + } + + if (pvt::is_colorspace_srgb(m_spec, false)) m_spec.attribute("Exif:ColorSpace", 1); // Deal with missing XResolution or YResolution, or a PixelAspectRatio diff --git a/src/webp.imageio/webpinput.cpp b/src/webp.imageio/webpinput.cpp index 09cc08c4cd..c7011c0309 100644 --- a/src/webp.imageio/webpinput.cpp +++ b/src/webp.imageio/webpinput.cpp @@ -7,6 +7,8 @@ #include #include +#include "imageio_pvt.h" + #include #include @@ -162,7 +164,7 @@ WebpInput::open(const std::string& name, ImageSpec& spec, m_spec = ImageSpec(w, h, (m_demux_flags & ALPHA_FLAG) ? 4 : 3, TypeUInt8); m_scanline_size = m_spec.scanline_bytes(); - m_spec.set_colorspace("srgb_rec709_scene"); // webp is always sRGB + pvt::set_colorspace_srgb(m_spec); // webp is always sRGB if (m_demux_flags & ANIMATION_FLAG) { m_spec.attribute("oiio:Movie", 1); m_frame_count = (int)WebPDemuxGetI(m_demux, WEBP_FF_FRAME_COUNT); diff --git a/src/webp.imageio/webpoutput.cpp b/src/webp.imageio/webpoutput.cpp index 2c2acb85cc..fa7e89d410 100644 --- a/src/webp.imageio/webpoutput.cpp +++ b/src/webp.imageio/webpoutput.cpp @@ -11,6 +11,8 @@ #include #include +#include "imageio_pvt.h" + OIIO_PLUGIN_NAMESPACE_BEGIN namespace webp_pvt { @@ -142,16 +144,8 @@ bool WebpOutput::write_complete_data() { // Check if we have an optional ICC Profile to write. - const unsigned char* icc_data = nullptr; - uint32_t icc_data_length = 0; - bool has_icc_data = false; - const ParamValue* icc_profile_parameter = m_spec.find_attribute( - "ICCProfile"); - if (icc_profile_parameter != nullptr) { - icc_data = (const unsigned char*)icc_profile_parameter->data(); - icc_data_length = icc_profile_parameter->type().size(); - has_icc_data = (icc_data && icc_data_length > 0); - } + std::vector icc_profile = pvt::get_colorspace_icc_profile(m_spec); + const bool has_icc_data = icc_profile.size() > 0; // If we have ICC data, encode to memory first. This is required in order // to use the WebPMux assembly API below. @@ -203,7 +197,7 @@ WebpOutput::write_complete_data() WebPData image_data = { wrt.mem, wrt.size }; WebPMuxSetImage(mux, &image_data, false); - WebPData icc_chunk = { icc_data, size_t(icc_data_length) }; + WebPData icc_chunk = { icc_profile.data(), icc_profile.size() }; WebPMuxSetChunk(mux, "ICCP", &icc_chunk, false); WebPData assembly; From df9357b7bcea2019bff92adf2d641162cc32f8c8 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Sat, 29 Nov 2025 02:21:53 +0100 Subject: [PATCH 2/4] feat: Support display color space interop IDs in I/O * Display referred interop IDs are now chosen over scene referred ones by default on file read. This more closely matches the standards for CICP, ICC and other color metadata. Most images will now have oiio:ColorSpace set to srgb_rec709_display rather than srgb_rec709_scene on file read. There is a new global attribute color:prefer_image_state that when changed from the default "display" to "scene" will prefer scene referred color spaces as before. * Both srgb_rec709_scene and srgb_rec709_display are now (distinct) built-in color spaces. The built-in "sRGB" color space name was changed to be an alias of srgb_rec709_display rather than srgb_rec709_scene. * Previously only srgb_rec709_scene was recognized as sRGB for file metadata and display, now srgb_rec709_display and g22_rec709_display are treated as sRGB as well. The reason for g22_rec709_display behavior is that this type of display is often used to correct for the discrepancy where images are encoded as sRGB but usually decoded as gamma 2.2 by the physical display. By encoding it as gamma 2.2 and claiming it's sRGB the transfer functions cancel out exactly. * g24_rec709_display is now recognized as having gamma 2.4, and the name g24_rec709_scene was replaced with ocio:g24_rec709_scene since the former is not an official interop ID. * cio:itu709_rec709_scene and ocio:lin_ciexyzd65_display were added to complete the list of interop IDs in OCIO configs that match a CICP. * ColorConfig now includes inactive colorspaces. In older ACES configs (like v2.1.0 bundled with OpenColorIO 2.3), the display color spaces are inactive. But we now heavily rely on them. Signed-off-by: Brecht Van Lommel --- src/doc/stdmetadata.rst | 6 +- src/include/OpenImageIO/color.h | 6 +- src/include/OpenImageIO/imageio.h | 11 + src/libOpenImageIO/color_ocio.cpp | 243 ++++++++++++------ src/libOpenImageIO/imageio.cpp | 9 + src/oiiotool/oiiotool.cpp | 2 +- src/raw.imageio/rawinput.cpp | 3 +- testsuite/bmp/ref/out.txt | 62 ++--- testsuite/dds/ref/out.txt | 14 +- testsuite/gif/ref/out.txt | 30 +-- testsuite/gpsread/ref/out-alt.txt | 4 +- testsuite/gpsread/ref/out-jpeg9d.txt | 4 +- testsuite/gpsread/ref/out.txt | 4 +- testsuite/heif/ref/out-libheif1.12-orient.txt | 10 +- testsuite/heif/ref/out-libheif1.4.txt | 10 +- testsuite/heif/ref/out-libheif1.5.txt | 10 +- testsuite/heif/ref/out-libheif1.9-alt2.txt | 6 +- .../heif/ref/out-libheif1.9-with-av1-alt2.txt | 10 +- .../heif/ref/out-libheif1.9-with-av1.txt | 10 +- testsuite/heif/ref/out-libheif1.9.txt | 6 +- testsuite/ico/ref/out.txt | 2 +- testsuite/jpeg-corrupt/ref/out-alt.txt | 4 +- testsuite/jpeg-corrupt/ref/out-alt2.txt | 6 +- testsuite/jpeg-corrupt/ref/out-alt3.txt | 6 +- testsuite/jpeg-corrupt/ref/out-alt4.txt | 6 +- testsuite/jpeg-corrupt/ref/out.txt | 6 +- testsuite/jpeg-metadata/ref/out.txt | 16 +- testsuite/jpeg/ref/out.txt | 2 +- testsuite/jpeg2000-j2kp4files/ref/out-alt.txt | 18 +- .../jpeg2000-j2kp4files/ref/out-spinux.txt | 18 +- testsuite/jpeg2000-j2kp4files/ref/out.txt | 18 +- testsuite/oiiotool-attribs/ref/out-jpeg9d.txt | 12 +- testsuite/oiiotool-attribs/ref/out.txt | 12 +- testsuite/png/ref/out-libpng15.txt | 33 ++- testsuite/png/ref/out.txt | 35 ++- testsuite/png/run.py | 10 + testsuite/psd/ref/out-linuxarm.txt | 58 ++--- testsuite/psd/ref/out.txt | 58 ++--- .../python-colorconfig/ref/out-ocio23.txt | 12 +- .../python-colorconfig/ref/out-ocio24.txt | 12 +- .../python-colorconfig/ref/out-ocio25.txt | 12 +- testsuite/python-colorconfig/ref/out.txt | 4 +- testsuite/python-imageinput/ref/out-alt.txt | 2 +- testsuite/python-imageinput/ref/out-alt2.txt | 2 +- .../python-imageinput/ref/out-py37-jpeg9d.txt | 2 +- .../ref/out-python3-win-2.txt | 2 +- .../python-imageinput/ref/out-python3-win.txt | 2 +- .../python-imageinput/ref/out-python3.txt | 2 +- testsuite/python-imageinput/ref/out.txt | 2 +- testsuite/tiff-suite/ref/out-alt.txt | 4 +- testsuite/tiff-suite/ref/out-alt2.txt | 4 +- testsuite/tiff-suite/ref/out-jpeg9b.txt | 4 +- testsuite/tiff-suite/ref/out-jpeg9d-alt.txt | 4 +- testsuite/tiff-suite/ref/out.txt | 4 +- testsuite/webp/ref/out-webp1.1.txt | 8 +- 55 files changed, 514 insertions(+), 348 deletions(-) diff --git a/src/doc/stdmetadata.rst b/src/doc/stdmetadata.rst index 70a3fd6e2f..51e56cab8f 100644 --- a/src/doc/stdmetadata.rst +++ b/src/doc/stdmetadata.rst @@ -149,9 +149,11 @@ Color information - `"lin_ap1_scene"`, `"ACEScg"` : ACEScg color space encoding. - `"lin_ap0_scene"` : ACES2065-1, the recommended ACES space for interchange and archiving. - - `"srgb_rec709_scene"` : Using standard (piecewise) sRGB response and + - `"srgb_rec709_display"` : Using standard (piecewise) sRGB response and primaries. The token `"sRGB"` is treated as a synonym. - - `"g22_rec709_scene"` : Rec709/sRGB primaries, but using a response curve + - `"srgb_rec709_scene"` : Same response and primaries as + `"srgb_rec709_display"` but for scene referred images. + - `"g22_rec709_display"` : Rec709/sRGB primaries, but using a response curve corresponding to gamma 2.2. Additionally, `"scene_linear"` is a role that is appropriate for color diff --git a/src/include/OpenImageIO/color.h b/src/include/OpenImageIO/color.h index 99eba56396..59014adbb4 100644 --- a/src/include/OpenImageIO/color.h +++ b/src/include/OpenImageIO/color.h @@ -415,10 +415,14 @@ class OIIO_API ColorConfig { string_view get_color_interop_id(string_view colorspace) const; /// Find color interop ID corresponding to the CICP code. + /// If prefer_image_state is set to "scene", prefer returning a scene + /// referred interop ID over a display referred interop ID if both exist. /// Returns empty string if not found. /// /// @version 3.1 - string_view get_color_interop_id(const int cicp[4]) const; + string_view + get_color_interop_id(const int cicp[4], + string_view prefer_image_state = "display") const; /// Return a filename or other identifier for the config we're using. std::string configname() const; diff --git a/src/include/OpenImageIO/imageio.h b/src/include/OpenImageIO/imageio.h index b400650c3e..d8194b52ed 100644 --- a/src/include/OpenImageIO/imageio.h +++ b/src/include/OpenImageIO/imageio.h @@ -3843,6 +3843,17 @@ OIIO_API std::string geterror(bool clear = true); /// For more information, please see OpenImageIO's documentation on the /// built-in PNG format support. /// +/// - `string color:prefer_image_state` ("display") +/// +/// When the color space of an image file is ambiguous and can be +/// interpreted as either a display referred or scene referred, by default +/// the `oiio:ColorSpace` attribute will be set to a display color space +/// like `srgb_rec709_display`. +/// +/// By setting the preferred image state to "scene", the corresponding +/// scene referred color space like `srgb_rec709_scene` will be chosen +/// instead. For textures in particular this can be a better default guess. +/// /// - `int limits:channels` (1024) /// /// When nonzero, the maximum number of color channels in an image. Image diff --git a/src/libOpenImageIO/color_ocio.cpp b/src/libOpenImageIO/color_ocio.cpp index 3446b31e7e..e760fe6029 100644 --- a/src/libOpenImageIO/color_ocio.cpp +++ b/src/libOpenImageIO/color_ocio.cpp @@ -55,6 +55,7 @@ static int disable_builtin_configs = Strutil::stoi( Sysutil::getenv("OIIO_DISABLE_BUILTIN_OCIO_CONFIGS")); static OCIO::ConstConfigRcPtr ocio_current_config; +static const ustring scene_us("scene"); const ColorConfig& @@ -159,13 +160,15 @@ struct CSInfo { int index; // More than one can have the same index -- aliases enum Flags { none = 0, - is_linear_response = 1, // any cs with linear transfer function - is_scene_linear = 2, // equivalent to scene_linear - is_srgb = 4, // sRGB (primaries, and transfer function) - is_lin_srgb = 8, // sRGB/Rec709 primaries, linear response - is_ACEScg = 16, // ACEScg - is_Rec709 = 32, // Rec709 primaries and transfer function - is_known = is_srgb | is_lin_srgb | is_ACEScg | is_Rec709 + is_linear_response = 1, // any cs with linear transfer function + is_scene_linear = 2, // equivalent to scene_linear + is_srgb_display = 4, // sRGB (primaries, and transfer function) display + is_srgb_scene = 8, // sRGB (primaries, and transfer function) scene + is_lin_srgb = 16, // sRGB/Rec709 primaries, linear response + is_ACEScg = 32, // ACEScg + is_Rec709 = 64, // Rec709 primaries and transfer function + is_known = is_srgb_display | is_srgb_scene | is_lin_srgb | is_ACEScg + | is_Rec709 }; int m_flags = 0; bool examined = false; @@ -207,7 +210,8 @@ class ColorConfig::Impl { std::vector colorspaces; std::string scene_linear_alias; // Alias for a scene-linear color space std::string lin_srgb_alias; - std::string srgb_alias; + std::string srgb_display_alias; + std::string srgb_scene_alias; std::string ACEScg_alias; std::string Rec709_alias; mutable spin_rw_mutex m_mutex; @@ -403,9 +407,9 @@ class ColorConfig::Impl { void debug_print_aliases() { - DBG("Aliases: scene_linear={} lin_srgb={} srgb={} ACEScg={} Rec709={}\n", - scene_linear_alias, lin_srgb_alias, srgb_alias, ACEScg_alias, - Rec709_alias); + DBG("Aliases: scene_linear={} lin_srgb={} srgb_display={} srgb_scene={} ACEScg={} Rec709={}\n", + scene_linear_alias, lin_srgb_alias, srgb_display_alias, + srgb_scene_alias, ACEScg_alias, Rec709_alias); } // For OCIO 2.3+, we can ask for the equivalent of some built-in @@ -423,7 +427,7 @@ class ColorConfig::Impl { // ColorConfig utility to take inventory of the color spaces available. -// It sets up knowledge of "linear", "srgb_rec709_scene", "Rec709", etc, +// It sets up knowledge of "linear", "srgb_rec709_display", "Rec709", etc, // even if the underlying OCIO configuration lacks them. void ColorConfig::Impl::inventory() @@ -431,12 +435,23 @@ ColorConfig::Impl::inventory() DBG("inventorying config {}\n", configname()); if (config_ && !disable_ocio) { bool nonraw = false; - for (int i = 0, e = config_->getNumColorSpaces(); i < e; ++i) - nonraw |= !Strutil::iequals(config_->getColorSpaceNameByIndex(i), + // In older ACES configs the display color spaces are inactive but they + // are essential for interop IDs like srgb_rec709_display to work. + const int numcolorspaces + = config_->getNumColorSpaces(OCIO::SEARCH_REFERENCE_SPACE_ALL, + OCIO::COLORSPACE_ALL); + for (int i = 0; i < numcolorspaces; ++i) + nonraw |= !Strutil::iequals(config_->getColorSpaceNameByIndex( + OCIO::SEARCH_REFERENCE_SPACE_ALL, + OCIO::COLORSPACE_ALL, i), "raw"); if (nonraw) { - for (int i = 0, e = config_->getNumColorSpaces(); i < e; ++i) - add(config_->getColorSpaceNameByIndex(i), i); + for (int i = 0; i < numcolorspaces; ++i) { + add(config_->getColorSpaceNameByIndex( + OCIO::SEARCH_REFERENCE_SPACE_ALL, OCIO::COLORSPACE_ALL, + i), + i); + } for (auto&& cs : colorspaces) classify_by_name(cs); OCIO::ConstColorSpaceRcPtr lin = config_->getColorSpace( @@ -466,8 +481,9 @@ ColorConfig::Impl::inventory() add("lin_rec709_scene", 0, linflags); add("lin_srgb", 0, linflags); add("lin_rec709", 0, linflags); - add("srgb_rec709_scene", 1, CSInfo::is_srgb); - add("sRGB", 1, CSInfo::is_srgb); + add("srgb_rec709_display", 1, CSInfo::is_srgb_display); + add("srgb_rec709_scene", 1, CSInfo::is_srgb_scene); + add("sRGB", 1, CSInfo::is_srgb_display); add("Rec709", 2, CSInfo::is_Rec709); for (auto&& cs : colorspaces) @@ -581,14 +597,18 @@ ColorConfig::Impl::classify_by_name(CSInfo& cs) // General heuristics based on the names -- for a few canonical names, // believe them! Woe be unto the poor soul who names a color space "sRGB" // or "ACEScg" and it's really something entirely different. - if (Strutil::iequals(cs.name, "srgb_rec709_scene") - || Strutil::iequals(cs.name, "srgb_tx") - || Strutil::iequals(cs.name, "srgb_texture") - || Strutil::iequals(cs.name, "srgb texture") - || Strutil::iequals(cs.name, "srgb_rec709_scene") - || Strutil::iequals(cs.name, "sRGB - Texture") + // + if (Strutil::iequals(cs.name, "srgb_rec709_display") + || Strutil::iequals(cs.name, "srgb_display") + || Strutil::iequals(cs.name, "sRGB - Display") || Strutil::iequals(cs.name, "sRGB")) { - cs.setflag(CSInfo::is_srgb, srgb_alias); + cs.setflag(CSInfo::is_srgb_display, srgb_display_alias); + } else if (Strutil::iequals(cs.name, "srgb_rec709_scene") + || Strutil::iequals(cs.name, "srgb_tx") + || Strutil::iequals(cs.name, "srgb_texture") + || Strutil::iequals(cs.name, "srgb texture") + || Strutil::iequals(cs.name, "sRGB - Texture")) { + cs.setflag(CSInfo::is_srgb_scene, srgb_scene_alias); } else if (Strutil::iequals(cs.name, "lin_rec709_scene") || Strutil::iequals(cs.name, "lin_rec709") || Strutil::iequals(cs.name, "Linear Rec.709 (sRGB)") @@ -611,7 +631,7 @@ ColorConfig::Impl::classify_by_name(CSInfo& cs) ACEScg_alias); } else if (cs.name == "srgbf" || cs.name == "srgbh" || cs.name == "srgb16" || cs.name == "srgb8") { - cs.setflag(CSInfo::is_srgb, srgb_alias); + cs.setflag(CSInfo::is_srgb_display, srgb_display_alias); } else if (cs.name == "srgblnf" || cs.name == "srgblnh" || cs.name == "srgbln16" || cs.name == "srgbln8") { cs.setflag(CSInfo::is_lin_srgb, lin_srgb_alias); @@ -619,7 +639,9 @@ ColorConfig::Impl::classify_by_name(CSInfo& cs) #endif // Set up some canonical names - if (cs.flags() & CSInfo::is_srgb) + if (cs.flags() & CSInfo::is_srgb_display) + cs.canonical = "srgb_rec709_display"; + else if (cs.flags() & CSInfo::is_srgb_scene) cs.canonical = "srgb_rec709_scene"; else if (cs.flags() & CSInfo::is_lin_srgb) cs.canonical = "lin_rec709_scene"; @@ -666,8 +688,11 @@ ColorConfig::Impl::classify_by_conversions(CSInfo& cs) // inversion costs, and they're not gonna be our favourite // canonical spaces anyway. // DBG("{} has LUT3\n", cs.name); + } else if (check_same_as_builtin_transform(cs.name.c_str(), + "srgb_display")) { + cs.setflag(CSInfo::is_srgb_display, srgb_display_alias); } else if (check_same_as_builtin_transform(cs.name.c_str(), "srgb_tx")) { - cs.setflag(CSInfo::is_srgb, srgb_alias); + cs.setflag(CSInfo::is_srgb_scene, srgb_scene_alias); } else if (check_same_as_builtin_transform(cs.name.c_str(), "lin_srgb")) { cs.setflag(CSInfo::is_lin_srgb | CSInfo::is_linear_response, @@ -679,7 +704,9 @@ ColorConfig::Impl::classify_by_conversions(CSInfo& cs) } // Set up some canonical names - if (cs.flags() & CSInfo::is_srgb) + if (cs.flags() & CSInfo::is_srgb_display) + cs.canonical = "srgb_rec709_display"; + else if (cs.flags() & CSInfo::is_srgb_scene) cs.canonical = "srgb_rec709_scene"; else if (cs.flags() & CSInfo::is_lin_srgb) cs.canonical = "lin_rec709_scene"; @@ -729,14 +756,23 @@ ColorConfig::Impl::identify_builtin_equivalents() if (disable_builtin_configs) return; Timer timer; + if (auto n = IdentifyBuiltinColorSpace("srgb_display")) { + if (CSInfo* cs = find(n)) { + cs->setflag(CSInfo::is_srgb_display, srgb_display_alias); + DBG("Identified {} = builtin '{}'\n", "srgb_rec709_display", + cs->name); + } + } else { + DBG("No config space identified as srgb_display\n"); + } if (auto n = IdentifyBuiltinColorSpace("srgb_tx")) { if (CSInfo* cs = find(n)) { - cs->setflag(CSInfo::is_srgb, srgb_alias); + cs->setflag(CSInfo::is_srgb_scene, srgb_scene_alias); DBG("Identified {} = builtin '{}'\n", "srgb_rec709_scene", cs->name); } } else { - DBG("No config space identified as srgb\n"); + DBG("No config space identified as srgb_scene\n"); } DBG("identify_builtin_equivalents srgb took {:0.2f}s\n", timer.lap()); if (auto n = IdentifyBuiltinColorSpace("lin_srgb")) { @@ -839,8 +875,10 @@ ColorConfig::Impl::init(string_view filename) for (auto&& cs : colorspaces) { // examine(&cs); DBG("Color space '{}':\n", cs.name); - if (cs.flags() & CSInfo::is_srgb) - DBG("'{}' is srgb\n", cs.name); + if (cs.flags() & CSInfo::is_srgb_display) + DBG("'{}' is srgb_display\n", cs.name); + if (cs.flags() & CSInfo::is_srgb_scene) + DBG("'{}' is srgb_scene\n", cs.name); if (cs.flags() & CSInfo::is_lin_srgb) DBG("'{}' is lin_srgb\n", cs.name); if (cs.flags() & CSInfo::is_ACEScg) @@ -1339,17 +1377,21 @@ ColorConfig::Impl::resolve(string_view name) const if (config && !disable_ocio) { const char* namestr = c_str(name); OCIO::ConstColorSpaceRcPtr cs = config->getColorSpace(namestr); - if (cs) + if (cs) { return cs->getName(); + } } // OCIO did not know this name as a color space, role, or alias. // Maybe it's an informal alias of common names? spin_rw_write_lock lock(m_mutex); if ((Strutil::iequals(name, "sRGB") - || Strutil::iequals(name, "srgb_rec709_scene")) - && !srgb_alias.empty()) - return srgb_alias; + || Strutil::iequals(name, "srgb_rec709_display")) + && !srgb_display_alias.empty()) + return srgb_display_alias; + if (Strutil::iequals(name, "srgb_rec709_scene") + && !srgb_scene_alias.empty()) + return srgb_scene_alias; if ((Strutil::iequals(name, "lin_srgb") || Strutil::iequals(name, "lin_rec709") || Strutil::iequals(name, "lin_rec709_scene") @@ -1393,7 +1435,8 @@ ColorConfig::equivalent(string_view color_space1, // If the color spaces' flags (when masking only the bits that refer to // specific known color spaces) match, consider them equivalent. - const int mask = CSInfo::is_srgb | CSInfo::is_lin_srgb | CSInfo::is_ACEScg + const int mask = CSInfo::is_srgb_display | CSInfo::is_srgb_scene + | CSInfo::is_lin_srgb | CSInfo::is_ACEScg | CSInfo::is_Rec709; const CSInfo* csi1 = getImpl()->find(color_space1); const CSInfo* csi2 = getImpl()->find(color_space2); @@ -2057,6 +2100,43 @@ struct ColorInteropID { // Mapping between color interop ID and CICP, based on Color Interop Forum // recommendations. constexpr ColorInteropID color_interop_ids[] = { + // Display referred interop IDs. + { "srgb_rec709_display", CICPPrimaries::Rec709, CICPTransfer::sRGB, + CICPMatrix::BT709 }, + // Not all software interprets this CICP the same, see the + // "QuickTime Gamma Shift" issue. We follow the CIF recommendation and + // interpret it as BT.1886. + { "g24_rec709_display", CICPPrimaries::Rec709, CICPTransfer::BT709, + CICPMatrix::BT709 }, + { "srgb_p3d65_display", CICPPrimaries::P3D65, CICPTransfer::sRGB, + CICPMatrix::BT709 }, + { "srgbe_p3d65_display", CICPPrimaries::P3D65, CICPTransfer::sRGB, + CICPMatrix::BT709 }, + { "pq_p3d65_display", CICPPrimaries::P3D65, CICPTransfer::PQ, + CICPMatrix::Rec2020_NCL }, + { "pq_rec2020_display", CICPPrimaries::Rec2020, CICPTransfer::PQ, + CICPMatrix::Rec2020_NCL }, + { "hlg_rec2020_display", CICPPrimaries::Rec2020, CICPTransfer::HLG, + CICPMatrix::Rec2020_NCL }, + // Mapped to sRGB as a gamma 2.2 display is more likely meant to be written + // as sRGB. This type of display is often used to correct for the discrepancy + // where images are encoded as sRGB but usually decoded as gamma 2.2 by the + // physical display. + // For read and write, g22_rec709_scene. still maps to Gamma 2.2. + { "g22_rec709_display", CICPPrimaries::Rec709, CICPTransfer::sRGB, + CICPMatrix::BT709 }, + // No CICP code for Adobe RGB primaries. + { "g22_adobergb_display" }, + { "g26_p3d65_display", CICPPrimaries::P3D65, CICPTransfer::Gamma26, + CICPMatrix::BT709 }, + { "g26_xyzd65_display", CICPPrimaries::XYZD65, CICPTransfer::Gamma26, + CICPMatrix::Unspecified }, + { "pq_xyzd65_display", CICPPrimaries::XYZD65, CICPTransfer::PQ, + CICPMatrix::Unspecified }, + // OpenColorIO interop IDs. + { "ocio:lin_ciexyzd65_display", CICPPrimaries::XYZD65, CICPTransfer::Linear, + CICPMatrix::Unspecified }, + // Scene referred interop IDs first so they are the default in automatic // conversion from CICP to interop ID. Some are not display color spaces // at all, but can be represented by CICP anyway. @@ -2083,35 +2163,12 @@ constexpr ColorInteropID color_interop_ids[] = { { "g22_adobergb_scene" }, { "data" }, { "unknown" }, - - // Display referred interop IDs. - { "srgb_rec709_display", CICPPrimaries::Rec709, CICPTransfer::sRGB, - CICPMatrix::BT709 }, - { "g24_rec709_display", CICPPrimaries::Rec709, CICPTransfer::BT709, + // OpenColorIO interop IDs. + { "ocio:g24_rec709_scene", CICPPrimaries::Rec709, CICPTransfer::BT709, CICPMatrix::BT709 }, - { "srgb_p3d65_display", CICPPrimaries::P3D65, CICPTransfer::sRGB, - CICPMatrix::BT709 }, - { "srgbe_p3d65_display", CICPPrimaries::P3D65, CICPTransfer::sRGB, - CICPMatrix::BT709 }, - { "pq_p3d65_display", CICPPrimaries::P3D65, CICPTransfer::PQ, - CICPMatrix::Rec2020_NCL }, - { "pq_rec2020_display", CICPPrimaries::Rec2020, CICPTransfer::PQ, - CICPMatrix::Rec2020_NCL }, - { "hlg_rec2020_display", CICPPrimaries::Rec2020, CICPTransfer::HLG, - CICPMatrix::Rec2020_NCL }, - // No CICP mapping to keep previous behavior unchanged, as Gamma 2.2 - // display is more likely meant to be written as sRGB. On read the - // scene referred interop ID will be used. - { "g22_rec709_display", - /* CICPPrimaries::Rec709, CICPTransfer::Gamma22, CICPMatrix::BT709 */ }, - // No CICP code for Adobe RGB primaries. - { "g22_adobergb_display" }, - { "g26_p3d65_display", CICPPrimaries::P3D65, CICPTransfer::Gamma26, - CICPMatrix::BT709 }, - { "g26_xyzd65_display", CICPPrimaries::XYZD65, CICPTransfer::Gamma26, - CICPMatrix::Unspecified }, - { "pq_xyzd65_display", CICPPrimaries::XYZD65, CICPTransfer::PQ, - CICPMatrix::Unspecified }, + // Not mapped to any CICP, because we already interpret the potential CICP + // as g24_rec709_*, see explanation for g24_rec709_display above. + { "ocio:itu709_rec709_scene" }, }; } // namespace @@ -2139,15 +2196,23 @@ ColorConfig::get_color_interop_id(string_view colorspace) const } string_view -ColorConfig::get_color_interop_id(const int cicp[4]) const +ColorConfig::get_color_interop_id(const int cicp[4], + const string_view prefer_image_state) const { + string_view other_interop_id; for (const ColorInteropID& interop : color_interop_ids) { if (interop.has_cicp && interop.cicp[0] == cicp[0] && interop.cicp[1] == cicp[1]) { - return interop.interop_id; + if (!Strutil::ends_with(interop.interop_id, prefer_image_state)) { + if (other_interop_id.empty()) { + other_interop_id = interop.interop_id; + } + } else { + return interop.interop_id; + } } } - return ""; + return other_interop_id; } cspan @@ -2791,7 +2856,7 @@ ColorConfig::set_colorspace(ImageSpec& spec, string_view colorspace) const // including some format-specific things that we don't want to propagate // from input to output if we know that color space transformations have // occurred. - if (!equivalent(colorspace, "srgb_rec709_scene")) + if (!OIIO::pvt::is_colorspace_srgb(spec, false)) spec.erase_attribute("Exif:ColorSpace"); spec.erase_attribute("tiff:ColorSpace"); spec.erase_attribute("tiff:PhotometricInterpretation"); @@ -2810,13 +2875,21 @@ ColorConfig::set_colorspace_rec709_gamma(ImageSpec& spec, float gamma) const set_colorspace(spec, "g18_rec709_scene"); spec.attribute("oiio:Gamma", 1.8f); } else if (fabsf(gamma - 2.2f) <= 0.01f) { - set_colorspace(spec, "g22_rec709_scene"); + set_colorspace(spec, + (OIIO::get_string_attribute("color:prefer_image_state") + == scene_us) + ? "g22_rec709_scene" + : "g22_rec709_display"); spec.attribute("oiio:Gamma", 2.2f); } else if (fabsf(gamma - 2.4f) <= 0.01f) { - set_colorspace(spec, "g24_rec709_scene"); + set_colorspace(spec, + (OIIO::get_string_attribute("color:prefer_image_state") + == scene_us) + ? "ocio:g24_rec709_scene" + : "g24_rec709_display"); spec.attribute("oiio:Gamma", 2.4f); } else { - set_colorspace(spec, Strutil::fmt::format("g{}_rec709_scene", + set_colorspace(spec, Strutil::fmt::format("g{}_rec709_display", std::lround(gamma * 10.0f))); spec.attribute("oiio:Gamma", gamma); } @@ -2842,10 +2915,15 @@ OIIO_NAMESPACE_BEGIN void pvt::set_colorspace_srgb(ImageSpec& spec, bool erase_other_attributes) { + string_view srgb_colorspace + = (OIIO::get_string_attribute("color:prefer_image_state") + == OIIO::v3_1::scene_us) + ? "srgb_rec709_scene" + : "srgb_rec709_display"; if (erase_other_attributes) { - spec.set_colorspace("srgb_rec709_scene"); + spec.set_colorspace(srgb_colorspace); } else { - spec.attribute("oiio:ColorSpace", "srgb_rec709_scene"); + spec.attribute("oiio:ColorSpace", srgb_colorspace); } } @@ -2859,7 +2937,11 @@ pvt::is_colorspace_srgb(const ImageSpec& spec, bool default_to_srgb) const ColorConfig& colorconfig(ColorConfig::default_colorconfig()); string_view interop_id = colorconfig.get_color_interop_id(colorspace); - return interop_id == "srgb_rec709_scene"; + + // See the interop table above for why g22_rec709_display is treated as sRGB + return (interop_id == "srgb_rec709_scene" + || interop_id == "srgb_rec709_display" + || interop_id == "g22_rec709_display"); } float @@ -2874,11 +2956,13 @@ pvt::get_colorspace_rec709_gamma(const ImageSpec& spec) || colorconfig.equivalent(colorspace, "scene_linear") || interop_id == "lin_rec709_scene") return 1.0f; + // See the interop table above for why g22_rec709_display is not treated as gamma else if (interop_id == "g22_rec709_scene") return 2.2f; - // Note g24_rec709_scene is not a standard interop ID - else if (colorconfig.equivalent(colorspace, "g24_rec709_scene")) + else if (interop_id == "ocio:g24_rec709_scene" + || interop_id == "g24_rec709_display") return 2.4f; + // Note g18_rec709_display is not an interop ID else if (interop_id == "g18_rec709_scene") return 1.8f; // Back compatible, this is DEPRECATED(3.1) @@ -2910,7 +2994,8 @@ pvt::set_colorspace_cicp(ImageSpec& spec, const int cicp[4]) { spec.attribute("CICP", TypeDesc(TypeDesc::INT, 4), cicp); const ColorConfig& colorconfig(ColorConfig::default_colorconfig()); - string_view interop_id = colorconfig.get_color_interop_id(cicp); + string_view interop_id = colorconfig.get_color_interop_id( + cicp, OIIO::get_string_attribute("color:prefer_image_state")); if (!interop_id.empty()) spec.attribute("oiio:ColorSpace", interop_id); } diff --git a/src/libOpenImageIO/imageio.cpp b/src/libOpenImageIO/imageio.cpp index 909f8529d4..bc539c8d53 100644 --- a/src/libOpenImageIO/imageio.cpp +++ b/src/libOpenImageIO/imageio.cpp @@ -53,6 +53,7 @@ int png_linear_premult(0); int tiff_half(0); int tiff_multithread(1); int dds_bc5normal(0); +ustring color_prefer_image_state("display"); int limit_channels(1024); int limit_imagesize_MB(std::min(32 * 1024, int(Sysutil::physical_memory() >> 20))); @@ -406,6 +407,10 @@ attribute(string_view name, TypeDesc type, const void* val) dds_bc5normal = *(const int*)val; return true; } + if (name == "color:prefer_image_state" && type == TypeString) { + color_prefer_image_state = ustring(*(const char**)val); + return true; + } if (name == "limits:channels" && type == TypeInt) { limit_channels = *(const int*)val; return true; @@ -612,6 +617,10 @@ getattribute(string_view name, TypeDesc type, void* val) *(int*)val = dds_bc5normal; return true; } + if (name == "color:prefer_image_state" && type == TypeString) { + *(ustring*)val = color_prefer_image_state; + return true; + } if (name == "oiio:print_uncaught_errors" && type == TypeInt) { *(int*)val = oiio_print_uncaught_errors; return true; diff --git a/src/oiiotool/oiiotool.cpp b/src/oiiotool/oiiotool.cpp index 3c33cf2e50..e9b2367cf9 100644 --- a/src/oiiotool/oiiotool.cpp +++ b/src/oiiotool/oiiotool.cpp @@ -5789,7 +5789,7 @@ output_file(Oiiotool& ot, cspan argv) || Strutil::iends_with(filename, ".jpeg") || Strutil::iends_with(filename, ".gif") || Strutil::iends_with(filename, ".webp"))) - outcolorspace = string_view("srgb_rec709_scene"); + outcolorspace = string_view("srgb_rec709_display"); if (outcolorspace.empty() && (Strutil::iends_with(filename, ".ppm") || Strutil::iends_with(filename, ".pnm"))) diff --git a/src/raw.imageio/rawinput.cpp b/src/raw.imageio/rawinput.cpp index 513f1f6fcf..a87773032c 100644 --- a/src/raw.imageio/rawinput.cpp +++ b/src/raw.imageio/rawinput.cpp @@ -577,7 +577,8 @@ RawInput::open_raw(bool unpack, bool process, const std::string& name, m_processor->imgdata.params.output_color = 0; m_processor->imgdata.params.gamm[0] = 1.0; m_processor->imgdata.params.gamm[1] = 1.0; - } else if (cs.empty() || colorconfig.equivalent(cs, "srgb_rec709_scene") + } else if (cs.empty() || colorconfig.equivalent(cs, "srgb_rec709_display") + || colorconfig.equivalent(cs, "srgb_rec709_scene") || Strutil::iequals(cs, "sRGB") /* Necessary? */) { // Request explicit sRGB, including usual sRGB response m_processor->imgdata.params.output_color = 1; diff --git a/testsuite/bmp/ref/out.txt b/testsuite/bmp/ref/out.txt index 13fc651063..f962eaecf6 100644 --- a/testsuite/bmp/ref/out.txt +++ b/testsuite/bmp/ref/out.txt @@ -4,7 +4,7 @@ Reading ../oiio-images/bmpsuite/g01bg.bmp channel list: R, G, B bmp:bitsperpixel: 1 bmp:version: 3 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Comparing "../oiio-images/bmpsuite/g01bg.bmp" and "g01bg.bmp" PASS Reading ../oiio-images/bmpsuite/g01bw.bmp @@ -13,7 +13,7 @@ Reading ../oiio-images/bmpsuite/g01bw.bmp channel list: R, G, B bmp:bitsperpixel: 1 bmp:version: 3 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Comparing "../oiio-images/bmpsuite/g01bw.bmp" and "g01bw.bmp" PASS Reading ../oiio-images/bmpsuite/g01p1.bmp @@ -22,7 +22,7 @@ Reading ../oiio-images/bmpsuite/g01p1.bmp channel list: R, G, B bmp:bitsperpixel: 1 bmp:version: 3 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Comparing "../oiio-images/bmpsuite/g01p1.bmp" and "g01p1.bmp" PASS Reading ../oiio-images/bmpsuite/g01wb.bmp @@ -31,7 +31,7 @@ Reading ../oiio-images/bmpsuite/g01wb.bmp channel list: R, G, B bmp:bitsperpixel: 1 bmp:version: 3 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Comparing "../oiio-images/bmpsuite/g01wb.bmp" and "g01wb.bmp" PASS Reading ../oiio-images/bmpsuite/g04.bmp @@ -40,7 +40,7 @@ Reading ../oiio-images/bmpsuite/g04.bmp channel list: R, G, B bmp:bitsperpixel: 4 bmp:version: 3 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Comparing "../oiio-images/bmpsuite/g04.bmp" and "g04.bmp" PASS Reading ../oiio-images/bmpsuite/g04p4.bmp @@ -49,7 +49,7 @@ Reading ../oiio-images/bmpsuite/g04p4.bmp channel list: R, G, B bmp:bitsperpixel: 4 bmp:version: 3 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Comparing "../oiio-images/bmpsuite/g04p4.bmp" and "g04p4.bmp" PASS Reading ../oiio-images/bmpsuite/g04rle.bmp @@ -59,7 +59,7 @@ Reading ../oiio-images/bmpsuite/g04rle.bmp compression: "rle4" bmp:bitsperpixel: 4 bmp:version: 3 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Comparing "../oiio-images/bmpsuite/g04rle.bmp" and "g04rle.bmp" PASS Reading ../oiio-images/bmpsuite/g08.bmp @@ -68,7 +68,7 @@ Reading ../oiio-images/bmpsuite/g08.bmp channel list: R, G, B bmp:bitsperpixel: 8 bmp:version: 3 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Comparing "../oiio-images/bmpsuite/g08.bmp" and "g08.bmp" PASS Reading ../oiio-images/bmpsuite/g08os2.bmp @@ -77,7 +77,7 @@ Reading ../oiio-images/bmpsuite/g08os2.bmp channel list: R, G, B bmp:bitsperpixel: 8 bmp:version: 1 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Comparing "../oiio-images/bmpsuite/g08os2.bmp" and "g08os2.bmp" PASS Reading ../oiio-images/bmpsuite/g08p64.bmp @@ -86,7 +86,7 @@ Reading ../oiio-images/bmpsuite/g08p64.bmp channel list: Y bmp:bitsperpixel: 8 bmp:version: 3 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Comparing "../oiio-images/bmpsuite/g08p64.bmp" and "g08p64.bmp" PASS Reading ../oiio-images/bmpsuite/g08p256.bmp @@ -95,7 +95,7 @@ Reading ../oiio-images/bmpsuite/g08p256.bmp channel list: R, G, B bmp:bitsperpixel: 8 bmp:version: 3 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Comparing "../oiio-images/bmpsuite/g08p256.bmp" and "g08p256.bmp" PASS Reading ../oiio-images/bmpsuite/g08pi64.bmp @@ -104,7 +104,7 @@ Reading ../oiio-images/bmpsuite/g08pi64.bmp channel list: R, G, B bmp:bitsperpixel: 8 bmp:version: 3 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Comparing "../oiio-images/bmpsuite/g08pi64.bmp" and "g08pi64.bmp" PASS Reading ../oiio-images/bmpsuite/g08pi256.bmp @@ -113,7 +113,7 @@ Reading ../oiio-images/bmpsuite/g08pi256.bmp channel list: R, G, B bmp:bitsperpixel: 8 bmp:version: 3 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Comparing "../oiio-images/bmpsuite/g08pi256.bmp" and "g08pi256.bmp" PASS Reading ../oiio-images/bmpsuite/g08res11.bmp @@ -125,7 +125,7 @@ Reading ../oiio-images/bmpsuite/g08res11.bmp YResolution: 3937 bmp:bitsperpixel: 8 bmp:version: 3 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Comparing "../oiio-images/bmpsuite/g08res11.bmp" and "g08res11.bmp" PASS Reading ../oiio-images/bmpsuite/g08res21.bmp @@ -137,7 +137,7 @@ Reading ../oiio-images/bmpsuite/g08res21.bmp YResolution: 3937 bmp:bitsperpixel: 8 bmp:version: 3 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Comparing "../oiio-images/bmpsuite/g08res21.bmp" and "g08res21.bmp" PASS Reading ../oiio-images/bmpsuite/g08res22.bmp @@ -149,7 +149,7 @@ Reading ../oiio-images/bmpsuite/g08res22.bmp YResolution: 7874 bmp:bitsperpixel: 8 bmp:version: 3 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Comparing "../oiio-images/bmpsuite/g08res22.bmp" and "g08res22.bmp" PASS Reading ../oiio-images/bmpsuite/g08s0.bmp @@ -158,7 +158,7 @@ Reading ../oiio-images/bmpsuite/g08s0.bmp channel list: R, G, B bmp:bitsperpixel: 8 bmp:version: 3 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Comparing "../oiio-images/bmpsuite/g08s0.bmp" and "g08s0.bmp" PASS Reading ../oiio-images/bmpsuite/g08w124.bmp @@ -167,7 +167,7 @@ Reading ../oiio-images/bmpsuite/g08w124.bmp channel list: R, G, B bmp:bitsperpixel: 8 bmp:version: 3 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Comparing "../oiio-images/bmpsuite/g08w124.bmp" and "g08w124.bmp" PASS Reading ../oiio-images/bmpsuite/g08w125.bmp @@ -176,7 +176,7 @@ Reading ../oiio-images/bmpsuite/g08w125.bmp channel list: R, G, B bmp:bitsperpixel: 8 bmp:version: 3 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Comparing "../oiio-images/bmpsuite/g08w125.bmp" and "g08w125.bmp" PASS Reading ../oiio-images/bmpsuite/g08w126.bmp @@ -185,7 +185,7 @@ Reading ../oiio-images/bmpsuite/g08w126.bmp channel list: R, G, B bmp:bitsperpixel: 8 bmp:version: 3 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Comparing "../oiio-images/bmpsuite/g08w126.bmp" and "g08w126.bmp" PASS Reading ../oiio-images/bmpsuite/g08rle.bmp @@ -195,7 +195,7 @@ Reading ../oiio-images/bmpsuite/g08rle.bmp compression: "rle8" bmp:bitsperpixel: 8 bmp:version: 3 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Comparing "../oiio-images/bmpsuite/g08rle.bmp" and "g08rle.bmp" PASS Reading ../oiio-images/bmpsuite/g08offs.bmp @@ -204,7 +204,7 @@ Reading ../oiio-images/bmpsuite/g08offs.bmp channel list: R, G, B bmp:bitsperpixel: 8 bmp:version: 3 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Comparing "../oiio-images/bmpsuite/g08offs.bmp" and "g08offs.bmp" PASS Reading ../oiio-images/bmpsuite/g24.bmp @@ -212,7 +212,7 @@ Reading ../oiio-images/bmpsuite/g24.bmp SHA-1: B1FB63649469F31D02D7AD065D3128EE04CC662E channel list: R, G, B bmp:version: 3 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Comparing "../oiio-images/bmpsuite/g24.bmp" and "g24.bmp" PASS Reading ../oiio-images/bmpsuite/g32bf.bmp @@ -220,7 +220,7 @@ Reading ../oiio-images/bmpsuite/g32bf.bmp SHA-1: D8807C680B17C70CB33B43AC072E0A9121C551B4 channel list: R, G, B, A bmp:version: 3 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Comparing "../oiio-images/bmpsuite/g32bf.bmp" and "g32bf.bmp" PASS Reading ../oiio-images/bmpsuite/g32def.bmp @@ -228,7 +228,7 @@ Reading ../oiio-images/bmpsuite/g32def.bmp SHA-1: D8807C680B17C70CB33B43AC072E0A9121C551B4 channel list: R, G, B, A bmp:version: 3 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Comparing "../oiio-images/bmpsuite/g32def.bmp" and "g32def.bmp" PASS Reading ../oiio-images/bmpsuite/g16bf555.bmp @@ -238,7 +238,7 @@ Reading ../oiio-images/bmpsuite/g16bf555.bmp bmp:bitsperpixel: 16 bmp:version: 3 oiio:BitsPerSample: 5 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Comparing "../oiio-images/bmpsuite/g16bf555.bmp" and "g16bf555.bmp" PASS Reading ../oiio-images/bmpsuite/g16bf565.bmp @@ -248,7 +248,7 @@ Reading ../oiio-images/bmpsuite/g16bf565.bmp bmp:bitsperpixel: 16 bmp:version: 3 oiio:BitsPerSample: 5 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Comparing "../oiio-images/bmpsuite/g16bf565.bmp" and "g16bf565.bmp" PASS Reading ../oiio-images/bmpsuite/g16def555.bmp @@ -258,7 +258,7 @@ Reading ../oiio-images/bmpsuite/g16def555.bmp bmp:bitsperpixel: 16 bmp:version: 3 oiio:BitsPerSample: 5 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Comparing "../oiio-images/bmpsuite/g16def555.bmp" and "g16def555.bmp" PASS Reading src/g01bg2-v5.bmp @@ -269,7 +269,7 @@ src/g01bg2-v5.bmp : 127 x 64, 3 channel, uint8 bmp XResolution: 2835 YResolution: 2835 bmp:version: 5 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Comparing "src/g01bg2-v5.bmp" and "g01bg2-v5.bmp" PASS Reading src/PRINTER.BMP @@ -278,7 +278,7 @@ src/PRINTER.BMP : 160 x 120, 3 channel, uint8 bmp channel list: R, G, B bmp:bitsperpixel: 8 bmp:version: 1 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Comparing "src/PRINTER.BMP" and "PRINTER.BMP" PASS Reading ../oiio-images/bmp/gracehopper.bmp @@ -288,7 +288,7 @@ Reading ../oiio-images/bmp/gracehopper.bmp ResolutionUnit: "m" XResolution: 2835 YResolution: 2835 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Comparing "../oiio-images/bmp/gracehopper.bmp" and "gracehopper.bmp" PASS oiiotool ERROR: read : "src/decodecolormap-corrupt.bmp": Possible corrupted header, invalid palette size diff --git a/testsuite/dds/ref/out.txt b/testsuite/dds/ref/out.txt index 43c5a59564..8d9fa01cb6 100644 --- a/testsuite/dds/ref/out.txt +++ b/testsuite/dds/ref/out.txt @@ -184,49 +184,49 @@ Reading ../oiio-images/dds/dds_dxgi_bc1_srgb.dds channel list: R, G, B, A compression: "DXT1" textureformat: "Plain Texture" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Reading ../oiio-images/dds/dds_dxgi_bc2_srgb.dds ../oiio-images/dds/dds_dxgi_bc2_srgb.dds : 16 x 8, 4 channel, uint8 dds SHA-1: D99494018941ADCA11EAE469D8C6E598DA37A8BF channel list: R, G, B, A compression: "DXT3" textureformat: "Plain Texture" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Reading ../oiio-images/dds/dds_dxgi_bc3_srgb.dds ../oiio-images/dds/dds_dxgi_bc3_srgb.dds : 16 x 8, 4 channel, uint8 dds SHA-1: 75F9FCD1920A00966F2FE13DF40F4FB0A6CD8DED channel list: R, G, B, A compression: "DXT5" textureformat: "Plain Texture" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Reading ../oiio-images/dds/dds_dxgi_bc7_srgb.dds ../oiio-images/dds/dds_dxgi_bc7_srgb.dds : 16 x 8, 4 channel, uint8 dds SHA-1: 91DBAC0E5ED54D5BBEECA4C48AB704FA9F7FE317 channel list: R, G, B, A compression: "BC7" textureformat: "Plain Texture" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Reading ../oiio-images/dds/dds_dxgi_rgba8_srgb.dds ../oiio-images/dds/dds_dxgi_rgba8_srgb.dds : 16 x 8, 4 channel, uint8 dds SHA-1: 61986C7E2D4F402B4A268AE5187AAFAF1647C0E6 channel list: R, G, B, A textureformat: "Plain Texture" oiio:BitsPerSample: 32 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Reading ../oiio-images/dds/dds_dxgi_bgra8_srgb.dds ../oiio-images/dds/dds_dxgi_bgra8_srgb.dds : 16 x 8, 4 channel, uint8 dds SHA-1: 61986C7E2D4F402B4A268AE5187AAFAF1647C0E6 channel list: R, G, B, A textureformat: "Plain Texture" oiio:BitsPerSample: 32 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Reading ../oiio-images/dds/dds_dxgi_bgrx8_srgb.dds ../oiio-images/dds/dds_dxgi_bgrx8_srgb.dds : 16 x 8, 3 channel, uint8 dds SHA-1: 6BF57CCCCF14021926285CE97D25AEC150324476 channel list: R, G, B textureformat: "Plain Texture" oiio:BitsPerSample: 32 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Reading ../oiio-images/dds/dds_dxgi_rgb10a2.dds ../oiio-images/dds/dds_dxgi_rgb10a2.dds : 16 x 8, 4 channel, uint8 dds SHA-1: F38B31F89991752DAB792DC9FF29F7F7DE0E7911 diff --git a/testsuite/gif/ref/out.txt b/testsuite/gif/ref/out.txt index 3fef48ff09..1860494e65 100644 --- a/testsuite/gif/ref/out.txt +++ b/testsuite/gif/ref/out.txt @@ -6,21 +6,21 @@ Reading ../oiio-images/gif/gif_animation.gif channel list: R, G, B, A FramesPerSecond: 100/123 (0.813008) gif:Interlacing: 0 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" oiio:Movie: 1 subimage 1: 30 x 30, 4 channel, uint8 gif SHA-1: D69F1E35C727EEC9E3DF750374E41D42192DFFBE channel list: R, G, B, A FramesPerSecond: 100/123 (0.813008) gif:Interlacing: 0 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" oiio:Movie: 1 subimage 2: 30 x 30, 4 channel, uint8 gif SHA-1: 3897B49CE5378D3C65590497269B1BB3F9D7630F channel list: R, G, B, A FramesPerSecond: 100/123 (0.813008) gif:Interlacing: 0 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" oiio:Movie: 1 Reading ../oiio-images/gif/gif_oiio_logo_with_alpha.gif ../oiio-images/gif/gif_oiio_logo_with_alpha.gif : 135 x 135, 4 channel, uint8 gif @@ -28,37 +28,37 @@ Reading ../oiio-images/gif/gif_oiio_logo_with_alpha.gif channel list: R, G, B, A ImageDescription: "oiio logo with alpha" gif:Interlacing: 0 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Reading ../oiio-images/gif/gif_tahoe.gif ../oiio-images/gif/gif_tahoe.gif : 2048 x 1536, 4 channel, uint8 gif SHA-1: 4E76899178CDAA94690E52CD18E07B810E40A273 channel list: R, G, B, A gif:Interlacing: 0 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Reading ../oiio-images/gif/gif_tahoe_interlaced.gif ../oiio-images/gif/gif_tahoe_interlaced.gif : 2048 x 1536, 4 channel, uint8 gif SHA-1: 4E76899178CDAA94690E52CD18E07B810E40A273 channel list: R, G, B, A gif:Interlacing: 1 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Reading ../oiio-images/gif/gif_bluedot.gif ../oiio-images/gif/gif_bluedot.gif : 1 x 1, 4 channel, uint8 gif SHA-1: EE0202803A0133BDA7BC40AC63091DCC58A4225B channel list: R, G, B, A gif:Interlacing: 0 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Reading ../oiio-images/gif/gif_diagonal_interlaced.gif ../oiio-images/gif/gif_diagonal_interlaced.gif : 200 x 200, 4 channel, uint8 gif SHA-1: CE1C613BB8B7EE80673B640CA3E392345C8C9FF4 channel list: R, G, B, A gif:Interlacing: 1 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Reading ../oiio-images/gif/gif_triangle_interlaced.gif ../oiio-images/gif/gif_triangle_interlaced.gif : 200 x 200, 4 channel, uint8 gif SHA-1: 44F8A0F4F39AB3ED532268B9EB45E09548925345 channel list: R, G, B, A gif:Interlacing: 1 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Reading ../oiio-images/gif/gif_test_disposal_method.gif ../oiio-images/gif/gif_test_disposal_method.gif : 50 x 50, 4 channel, uint8 gif 4 subimages: 50x50 [u8,u8,u8,u8], 50x50 [u8,u8,u8,u8], 50x50 [u8,u8,u8,u8], 50x50 [u8,u8,u8,u8] @@ -66,29 +66,29 @@ Reading ../oiio-images/gif/gif_test_disposal_method.gif SHA-1: 30839F361083DA6893F6A29B4F4628DCFBF9F1B5 channel list: R, G, B, A gif:Interlacing: 0 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" subimage 1: 50 x 50, 4 channel, uint8 gif SHA-1: 214A1EE026296A399D8A530C44275FC5BDFBA3BA channel list: R, G, B, A gif:Interlacing: 0 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" subimage 2: 50 x 50, 4 channel, uint8 gif SHA-1: 298C45330E7FAF68A6922C521EA766CA1594B1A4 channel list: R, G, B, A gif:Interlacing: 0 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" subimage 3: 50 x 50, 4 channel, uint8 gif SHA-1: 6D46A3F714B4BD68D289B9A945FF2716F1EB3A64 channel list: R, G, B, A gif:Interlacing: 0 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Reading ../oiio-images/gif/gif_test_loop_count.gif ../oiio-images/gif/gif_test_loop_count.gif : 20 x 20, 4 channel, uint8 gif SHA-1: C4AA837A5833B05CFCA50BD090D42AEB033069E1 channel list: R, G, B, A gif:Interlacing: 0 gif:LoopCount: 12345 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" oiio:LoopCount: 12345 Reading tahoe-tiny.gif tahoe-tiny.gif : 128 x 96, 4 channel, uint8 gif @@ -97,6 +97,6 @@ tahoe-tiny.gif : 128 x 96, 4 channel, uint8 gif FramesPerSecond: 100/100 (1) gif:Interlacing: 0 gif:LoopCount: 0 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" oiio:LoopCount: 0 oiio:Movie: 1 diff --git a/testsuite/gpsread/ref/out-alt.txt b/testsuite/gpsread/ref/out-alt.txt index c627986120..3ef6200edb 100644 --- a/testsuite/gpsread/ref/out-alt.txt +++ b/testsuite/gpsread/ref/out-alt.txt @@ -29,7 +29,7 @@ Reading ../oiio-images/tahoe-gps.jpg GPS:TimeStamp: 17, 56, 33 GPS:VersionID: 2, 2, 0, 0 jpeg:subsampling: "4:2:0" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Reading tahoe-gps.jpg tahoe-gps.jpg : 2048 x 1536, 3 channel, uint8 jpeg SHA-1: 2623446988E34395C6B0A4AA4FC75107C708BF18 @@ -58,4 +58,4 @@ tahoe-gps.jpg : 2048 x 1536, 3 channel, uint8 jpeg GPS:TimeStamp: 17, 56, 33 GPS:VersionID: 2, 2, 0, 0 jpeg:subsampling: "4:2:0" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" diff --git a/testsuite/gpsread/ref/out-jpeg9d.txt b/testsuite/gpsread/ref/out-jpeg9d.txt index 72d6be65f2..0a7add2070 100644 --- a/testsuite/gpsread/ref/out-jpeg9d.txt +++ b/testsuite/gpsread/ref/out-jpeg9d.txt @@ -29,7 +29,7 @@ Reading ../oiio-images/tahoe-gps.jpg GPS:TimeStamp: 17, 56, 33 GPS:VersionID: 2, 2, 0, 0 jpeg:subsampling: "4:2:0" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Reading tahoe-gps.jpg tahoe-gps.jpg : 2048 x 1536, 3 channel, uint8 jpeg SHA-1: A74C7DF2B01825DCB6881407AE77C11DC56AB741 @@ -58,4 +58,4 @@ tahoe-gps.jpg : 2048 x 1536, 3 channel, uint8 jpeg GPS:TimeStamp: 17, 56, 33 GPS:VersionID: 2, 2, 0, 0 jpeg:subsampling: "4:2:0" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" diff --git a/testsuite/gpsread/ref/out.txt b/testsuite/gpsread/ref/out.txt index 3e36ee7c64..0f44c386a6 100644 --- a/testsuite/gpsread/ref/out.txt +++ b/testsuite/gpsread/ref/out.txt @@ -29,7 +29,7 @@ Reading ../oiio-images/tahoe-gps.jpg GPS:TimeStamp: 17, 56, 33 GPS:VersionID: 2, 2, 0, 0 jpeg:subsampling: "4:2:0" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Reading tahoe-gps.jpg tahoe-gps.jpg : 2048 x 1536, 3 channel, uint8 jpeg SHA-1: 2623446988E34395C6B0A4AA4FC75107C708BF18 @@ -58,4 +58,4 @@ tahoe-gps.jpg : 2048 x 1536, 3 channel, uint8 jpeg GPS:TimeStamp: 17, 56, 33 GPS:VersionID: 2, 2, 0, 0 jpeg:subsampling: "4:2:0" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" diff --git a/testsuite/heif/ref/out-libheif1.12-orient.txt b/testsuite/heif/ref/out-libheif1.12-orient.txt index 875e3ac54e..04c1891490 100644 --- a/testsuite/heif/ref/out-libheif1.12-orient.txt +++ b/testsuite/heif/ref/out-libheif1.12-orient.txt @@ -38,12 +38,12 @@ ref/IMG_7702_small.heic : 512 x 300, 3 channel, uint8 heif Exif:SubsecTimeDigitized: "006" Exif:SubsecTimeOriginal: "006" Exif:WhiteBalance: 0 (auto) - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Reading ref/Chimera-AV1-8bit-162.avif ref/Chimera-AV1-8bit-162.avif : 480 x 270, 3 channel, uint8 heif SHA-1: F8FDAF1BD56A21E3AF99CF8EE7FA45434D2826C7 channel list: R, G, B - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Reading ref/test-10bit.avif ref/test-10bit.avif : 16 x 16, 4 channel, uint10 heif SHA-1: A217653C4E10FEBF080E26F9FC78F572184B1FDA @@ -54,7 +54,7 @@ ref/test-10bit.avif : 16 x 16, 4 channel, uint10 heif Exif:ImageHistory: "oiiotool --pattern fill:topleft=1,0,0,1:topright=0,1,0,1:bottomleft=0,0,1,1:bottomright=1,1,1,1 16x16 4 -d uint16 -o test16.png" heif:UnassociatedAlpha: 1 oiio:BitsPerSample: 10 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Reading cicp_pq.avif cicp_pq.avif : 16 x 16, 4 channel, uint10 heif SHA-1: 0F3CAB52D479BC23E9C981DBADDFEF1F792E5540 @@ -132,7 +132,7 @@ Reading ../oiio-images/heif/greyhounds-looking-for-a-table.heic GPS:LongitudeRef: "E" GPS:Speed: 0.171966 GPS:SpeedRef: "K" (km/hour) - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" oiio:OriginalOrientation: 8 Reading ../oiio-images/heif/sewing-threads.heic ../oiio-images/heif/sewing-threads.heic : 4000 x 3000, 3 channel, uint8 heif @@ -181,4 +181,4 @@ Reading ../oiio-images/heif/sewing-threads.heic GPS:LatitudeRef: "N" GPS:Longitude: 1, 49, 34.0187 GPS:LongitudeRef: "E" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" diff --git a/testsuite/heif/ref/out-libheif1.4.txt b/testsuite/heif/ref/out-libheif1.4.txt index 9d8304f14a..d615f579f8 100644 --- a/testsuite/heif/ref/out-libheif1.4.txt +++ b/testsuite/heif/ref/out-libheif1.4.txt @@ -38,12 +38,12 @@ ref/IMG_7702_small.heic : 512 x 300, 3 channel, uint8 heif Exif:SubsecTimeDigitized: "006" Exif:SubsecTimeOriginal: "006" Exif:WhiteBalance: 0 (auto) - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Reading ref/Chimera-AV1-8bit-162.avif ref/Chimera-AV1-8bit-162.avif : 480 x 270, 3 channel, uint8 heif SHA-1: F8FDAF1BD56A21E3AF99CF8EE7FA45434D2826C7 channel list: R, G, B - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Reading ref/test-10bit.avif ref/test-10bit.avif : 16 x 16, 4 channel, uint10 heif SHA-1: A217653C4E10FEBF080E26F9FC78F572184B1FDA @@ -54,7 +54,7 @@ ref/test-10bit.avif : 16 x 16, 4 channel, uint10 heif Exif:ImageHistory: "oiiotool --pattern fill:topleft=1,0,0,1:topright=0,1,0,1:bottomleft=0,0,1,1:bottomright=1,1,1,1 16x16 4 -d uint16 -o test16.png" heif:UnassociatedAlpha: 1 oiio:BitsPerSample: 10 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Reading cicp_pq.avif cicp_pq.avif : 16 x 16, 4 channel, uint10 heif SHA-1: 0F3CAB52D479BC23E9C981DBADDFEF1F792E5540 @@ -132,7 +132,7 @@ Reading ../oiio-images/heif/greyhounds-looking-for-a-table.heic GPS:LongitudeRef: "E" GPS:Speed: 0.171966 GPS:SpeedRef: "K" (km/hour) - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" oiio:OriginalOrientation: 6 Reading ../oiio-images/heif/sewing-threads.heic ../oiio-images/heif/sewing-threads.heic : 4000 x 3000, 3 channel, uint8 heif @@ -181,4 +181,4 @@ Reading ../oiio-images/heif/sewing-threads.heic GPS:LatitudeRef: "N" GPS:Longitude: 1, 49, 34.0187 GPS:LongitudeRef: "E" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" diff --git a/testsuite/heif/ref/out-libheif1.5.txt b/testsuite/heif/ref/out-libheif1.5.txt index 9dfd4ff23d..ce6282f820 100644 --- a/testsuite/heif/ref/out-libheif1.5.txt +++ b/testsuite/heif/ref/out-libheif1.5.txt @@ -38,12 +38,12 @@ ref/IMG_7702_small.heic : 512 x 300, 3 channel, uint8 heif Exif:SubsecTimeDigitized: "006" Exif:SubsecTimeOriginal: "006" Exif:WhiteBalance: 0 (auto) - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Reading ref/Chimera-AV1-8bit-162.avif ref/Chimera-AV1-8bit-162.avif : 480 x 270, 3 channel, uint8 heif SHA-1: F8FDAF1BD56A21E3AF99CF8EE7FA45434D2826C7 channel list: R, G, B - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Reading ref/test-10bit.avif ref/test-10bit.avif : 16 x 16, 4 channel, uint10 heif SHA-1: A217653C4E10FEBF080E26F9FC78F572184B1FDA @@ -54,7 +54,7 @@ ref/test-10bit.avif : 16 x 16, 4 channel, uint10 heif Exif:ImageHistory: "oiiotool --pattern fill:topleft=1,0,0,1:topright=0,1,0,1:bottomleft=0,0,1,1:bottomright=1,1,1,1 16x16 4 -d uint16 -o test16.png" heif:UnassociatedAlpha: 1 oiio:BitsPerSample: 10 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Reading cicp_pq.avif cicp_pq.avif : 16 x 16, 4 channel, uint10 heif SHA-1: 0F3CAB52D479BC23E9C981DBADDFEF1F792E5540 @@ -132,7 +132,7 @@ Reading ../oiio-images/heif/greyhounds-looking-for-a-table.heic GPS:LongitudeRef: "E" GPS:Speed: 0.171966 GPS:SpeedRef: "K" (km/hour) - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" oiio:OriginalOrientation: 6 Reading ../oiio-images/heif/sewing-threads.heic ../oiio-images/heif/sewing-threads.heic : 4000 x 3000, 3 channel, uint8 heif @@ -181,4 +181,4 @@ Reading ../oiio-images/heif/sewing-threads.heic GPS:LatitudeRef: "N" GPS:Longitude: 1, 49, 34.0187 GPS:LongitudeRef: "E" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" diff --git a/testsuite/heif/ref/out-libheif1.9-alt2.txt b/testsuite/heif/ref/out-libheif1.9-alt2.txt index f6448d4836..7715b193f4 100644 --- a/testsuite/heif/ref/out-libheif1.9-alt2.txt +++ b/testsuite/heif/ref/out-libheif1.9-alt2.txt @@ -38,7 +38,7 @@ ref/IMG_7702_small.heic : 512 x 300, 3 channel, uint8 heif Exif:SubsecTimeDigitized: "006" Exif:SubsecTimeOriginal: "006" Exif:WhiteBalance: 0 (auto) - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Reading ../oiio-images/heif/greyhounds-looking-for-a-table.heic ../oiio-images/heif/greyhounds-looking-for-a-table.heic : 3024 x 4032, 3 channel, uint8 heif SHA-1: 8064B23A1A995B0D6525AFB5248EEC6C730BBB6C @@ -96,7 +96,7 @@ Reading ../oiio-images/heif/greyhounds-looking-for-a-table.heic GPS:LongitudeRef: "E" GPS:Speed: 0.171966 GPS:SpeedRef: "K" (km/hour) - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" oiio:OriginalOrientation: 6 Reading ../oiio-images/heif/sewing-threads.heic ../oiio-images/heif/sewing-threads.heic : 4000 x 3000, 3 channel, uint8 heif @@ -145,4 +145,4 @@ Reading ../oiio-images/heif/sewing-threads.heic GPS:LatitudeRef: "N" GPS:Longitude: 1, 49, 34.0187 GPS:LongitudeRef: "E" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" diff --git a/testsuite/heif/ref/out-libheif1.9-with-av1-alt2.txt b/testsuite/heif/ref/out-libheif1.9-with-av1-alt2.txt index c938a6fe73..12d8b66a39 100644 --- a/testsuite/heif/ref/out-libheif1.9-with-av1-alt2.txt +++ b/testsuite/heif/ref/out-libheif1.9-with-av1-alt2.txt @@ -38,12 +38,12 @@ ref/IMG_7702_small.heic : 512 x 300, 3 channel, uint8 heif Exif:SubsecTimeDigitized: "006" Exif:SubsecTimeOriginal: "006" Exif:WhiteBalance: 0 (auto) - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Reading ref/Chimera-AV1-8bit-162.avif ref/Chimera-AV1-8bit-162.avif : 480 x 270, 3 channel, uint8 heif SHA-1: F8FDAF1BD56A21E3AF99CF8EE7FA45434D2826C7 channel list: R, G, B - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Reading ref/test-10bit.avif ref/test-10bit.avif : 16 x 16, 4 channel, uint10 heif SHA-1: A217653C4E10FEBF080E26F9FC78F572184B1FDA @@ -54,7 +54,7 @@ ref/test-10bit.avif : 16 x 16, 4 channel, uint10 heif Exif:ImageHistory: "oiiotool --pattern fill:topleft=1,0,0,1:topright=0,1,0,1:bottomleft=0,0,1,1:bottomright=1,1,1,1 16x16 4 -d uint16 -o test16.png" heif:UnassociatedAlpha: 1 oiio:BitsPerSample: 10 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Reading cicp_pq.avif cicp_pq.avif : 16 x 16, 4 channel, uint10 heif SHA-1: 0F3CAB52D479BC23E9C981DBADDFEF1F792E5540 @@ -132,7 +132,7 @@ Reading ../oiio-images/heif/greyhounds-looking-for-a-table.heic GPS:LongitudeRef: "E" GPS:Speed: 0.171966 GPS:SpeedRef: "K" (km/hour) - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" oiio:OriginalOrientation: 6 Reading ../oiio-images/heif/sewing-threads.heic ../oiio-images/heif/sewing-threads.heic : 4000 x 3000, 3 channel, uint8 heif @@ -181,4 +181,4 @@ Reading ../oiio-images/heif/sewing-threads.heic GPS:LatitudeRef: "N" GPS:Longitude: 1, 49, 34.0187 GPS:LongitudeRef: "E" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" diff --git a/testsuite/heif/ref/out-libheif1.9-with-av1.txt b/testsuite/heif/ref/out-libheif1.9-with-av1.txt index f6d7ca55a5..f659de41e1 100644 --- a/testsuite/heif/ref/out-libheif1.9-with-av1.txt +++ b/testsuite/heif/ref/out-libheif1.9-with-av1.txt @@ -38,12 +38,12 @@ ref/IMG_7702_small.heic : 512 x 300, 3 channel, uint8 heif Exif:SubsecTimeDigitized: "006" Exif:SubsecTimeOriginal: "006" Exif:WhiteBalance: 0 (auto) - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Reading ref/Chimera-AV1-8bit-162.avif ref/Chimera-AV1-8bit-162.avif : 480 x 270, 3 channel, uint8 heif SHA-1: F8FDAF1BD56A21E3AF99CF8EE7FA45434D2826C7 channel list: R, G, B - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Reading ref/test-10bit.avif ref/test-10bit.avif : 16 x 16, 4 channel, uint10 heif SHA-1: A217653C4E10FEBF080E26F9FC78F572184B1FDA @@ -54,7 +54,7 @@ ref/test-10bit.avif : 16 x 16, 4 channel, uint10 heif Exif:ImageHistory: "oiiotool --pattern fill:topleft=1,0,0,1:topright=0,1,0,1:bottomleft=0,0,1,1:bottomright=1,1,1,1 16x16 4 -d uint16 -o test16.png" heif:UnassociatedAlpha: 1 oiio:BitsPerSample: 10 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Reading cicp_pq.avif cicp_pq.avif : 16 x 16, 4 channel, uint10 heif SHA-1: 0F3CAB52D479BC23E9C981DBADDFEF1F792E5540 @@ -132,7 +132,7 @@ Reading ../oiio-images/heif/greyhounds-looking-for-a-table.heic GPS:LongitudeRef: "E" GPS:Speed: 0.171966 GPS:SpeedRef: "K" (km/hour) - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" oiio:OriginalOrientation: 6 Reading ../oiio-images/heif/sewing-threads.heic ../oiio-images/heif/sewing-threads.heic : 4000 x 3000, 3 channel, uint8 heif @@ -181,4 +181,4 @@ Reading ../oiio-images/heif/sewing-threads.heic GPS:LatitudeRef: "N" GPS:Longitude: 1, 49, 34.0187 GPS:LongitudeRef: "E" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" diff --git a/testsuite/heif/ref/out-libheif1.9.txt b/testsuite/heif/ref/out-libheif1.9.txt index 2778c33493..9c9a638f69 100644 --- a/testsuite/heif/ref/out-libheif1.9.txt +++ b/testsuite/heif/ref/out-libheif1.9.txt @@ -38,7 +38,7 @@ ref/IMG_7702_small.heic : 512 x 300, 3 channel, uint8 heif Exif:SubsecTimeDigitized: "006" Exif:SubsecTimeOriginal: "006" Exif:WhiteBalance: 0 (auto) - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Reading ../oiio-images/heif/greyhounds-looking-for-a-table.heic ../oiio-images/heif/greyhounds-looking-for-a-table.heic : 3024 x 4032, 3 channel, uint8 heif SHA-1: 8211F56BBABDC7615CCAF67CBF49741D1A292D2E @@ -96,7 +96,7 @@ Reading ../oiio-images/heif/greyhounds-looking-for-a-table.heic GPS:LongitudeRef: "E" GPS:Speed: 0.171966 GPS:SpeedRef: "K" (km/hour) - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" oiio:OriginalOrientation: 6 Reading ../oiio-images/heif/sewing-threads.heic ../oiio-images/heif/sewing-threads.heic : 4000 x 3000, 3 channel, uint8 heif @@ -145,4 +145,4 @@ Reading ../oiio-images/heif/sewing-threads.heic GPS:LatitudeRef: "N" GPS:Longitude: 1, 49, 34.0187 GPS:LongitudeRef: "E" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" diff --git a/testsuite/ico/ref/out.txt b/testsuite/ico/ref/out.txt index 0d15e10147..55e3f9d163 100644 --- a/testsuite/ico/ref/out.txt +++ b/testsuite/ico/ref/out.txt @@ -29,7 +29,7 @@ Reading ../oiio-images/ico/oiio.ico SHA-1: F44C9B94AB7D612F62A4DC29FD9C56FD173F2614 channel list: R, G, B, A oiio:BitsPerSample: 2 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" oiio:UnassociatedAlpha: 1 subimage 7: 48 x 48, 4 channel, uint8 ico SHA-1: 127700A3DACBF25FCD800642D78F8EE91EDE24B9 diff --git a/testsuite/jpeg-corrupt/ref/out-alt.txt b/testsuite/jpeg-corrupt/ref/out-alt.txt index 4a99ac71ec..40b231ee59 100644 --- a/testsuite/jpeg-corrupt/ref/out-alt.txt +++ b/testsuite/jpeg-corrupt/ref/out-alt.txt @@ -7,7 +7,7 @@ src/corrupt-exif.jpg : 256 x 256, 3 channel, uint8 jpeg XResolution: 300 YResolution: 300 jpeg:subsampling: "4:2:0" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Reading src/corrupt-exif-1626.jpg src/corrupt-exif-1626.jpg : 256 x 256, 3 channel, uint8 jpeg SHA-1: 6CBB7DB602A67DB300AB28842F20F6DCA02B82B1 @@ -17,6 +17,6 @@ src/corrupt-exif-1626.jpg : 256 x 256, 3 channel, uint8 jpeg XResolution: 300 YResolution: 300 jpeg:subsampling: "4:2:0" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" corrupt-icc-4551.jpg DCT coefficient (lossy) or spatial difference (lossless) out of range diff --git a/testsuite/jpeg-corrupt/ref/out-alt2.txt b/testsuite/jpeg-corrupt/ref/out-alt2.txt index bd34d53c33..f11dc88cea 100644 --- a/testsuite/jpeg-corrupt/ref/out-alt2.txt +++ b/testsuite/jpeg-corrupt/ref/out-alt2.txt @@ -7,7 +7,7 @@ src/corrupt-exif.jpg : 256 x 256, 3 channel, uint8 jpeg XResolution: 300 YResolution: 300 jpeg:subsampling: "4:2:0" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Reading src/corrupt-exif-1626.jpg src/corrupt-exif-1626.jpg : 256 x 256, 3 channel, uint8 jpeg SHA-1: FB711E5A0E4440C6B7C7A94835C44706569FFB78 @@ -17,7 +17,7 @@ src/corrupt-exif-1626.jpg : 256 x 256, 3 channel, uint8 jpeg XResolution: 300 YResolution: 300 jpeg:subsampling: "4:2:0" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" corrupt-icc-4551.jpg DCT coefficient (lossy) or spatial difference (lossless) out of range Reading src/corrupt-icc-4552.jpg @@ -43,4 +43,4 @@ src/corrupt-icc-4552.jpg : 1500 x 1000, 3 channel, uint8 jpeg ICCProfile:profile_version: "2.1.0" ICCProfile:rendering_intent: "Unknown" jpeg:subsampling: "4:2:0" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" diff --git a/testsuite/jpeg-corrupt/ref/out-alt3.txt b/testsuite/jpeg-corrupt/ref/out-alt3.txt index 1211dd48d6..13fc9bba2a 100644 --- a/testsuite/jpeg-corrupt/ref/out-alt3.txt +++ b/testsuite/jpeg-corrupt/ref/out-alt3.txt @@ -7,7 +7,7 @@ src/corrupt-exif.jpg : 256 x 256, 3 channel, uint8 jpeg XResolution: 300 YResolution: 300 jpeg:subsampling: "4:2:0" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Reading src/corrupt-exif-1626.jpg src/corrupt-exif-1626.jpg : 256 x 256, 3 channel, uint8 jpeg SHA-1: 6CBB7DB602A67DB300AB28842F20F6DCA02B82B1 @@ -17,7 +17,7 @@ src/corrupt-exif-1626.jpg : 256 x 256, 3 channel, uint8 jpeg XResolution: 300 YResolution: 300 jpeg:subsampling: "4:2:0" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" corrupt-icc-4551.jpg Reading src/corrupt-icc-4552.jpg src/corrupt-icc-4552.jpg : 1500 x 1000, 3 channel, uint8 jpeg @@ -42,4 +42,4 @@ src/corrupt-icc-4552.jpg : 1500 x 1000, 3 channel, uint8 jpeg ICCProfile:profile_version: "2.1.0" ICCProfile:rendering_intent: "Unknown" jpeg:subsampling: "4:2:0" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" diff --git a/testsuite/jpeg-corrupt/ref/out-alt4.txt b/testsuite/jpeg-corrupt/ref/out-alt4.txt index 7920812ec5..89cce873d7 100644 --- a/testsuite/jpeg-corrupt/ref/out-alt4.txt +++ b/testsuite/jpeg-corrupt/ref/out-alt4.txt @@ -7,7 +7,7 @@ src/corrupt-exif.jpg : 256 x 256, 3 channel, uint8 jpeg XResolution: 300 YResolution: 300 jpeg:subsampling: "4:2:0" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Reading src/corrupt-exif-1626.jpg src/corrupt-exif-1626.jpg : 256 x 256, 3 channel, uint8 jpeg SHA-1: FB711E5A0E4440C6B7C7A94835C44706569FFB78 @@ -17,7 +17,7 @@ src/corrupt-exif-1626.jpg : 256 x 256, 3 channel, uint8 jpeg XResolution: 300 YResolution: 300 jpeg:subsampling: "4:2:0" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" corrupt-icc-4551.jpg DCT coefficient out of range Reading src/corrupt-icc-4552.jpg @@ -43,4 +43,4 @@ src/corrupt-icc-4552.jpg : 1500 x 1000, 3 channel, uint8 jpeg ICCProfile:profile_version: "2.1.0" ICCProfile:rendering_intent: "Unknown" jpeg:subsampling: "4:2:0" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" diff --git a/testsuite/jpeg-corrupt/ref/out.txt b/testsuite/jpeg-corrupt/ref/out.txt index 13ae421558..14bad0e8f9 100644 --- a/testsuite/jpeg-corrupt/ref/out.txt +++ b/testsuite/jpeg-corrupt/ref/out.txt @@ -7,7 +7,7 @@ src/corrupt-exif.jpg : 256 x 256, 3 channel, uint8 jpeg XResolution: 300 YResolution: 300 jpeg:subsampling: "4:2:0" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Reading src/corrupt-exif-1626.jpg src/corrupt-exif-1626.jpg : 256 x 256, 3 channel, uint8 jpeg SHA-1: 6CBB7DB602A67DB300AB28842F20F6DCA02B82B1 @@ -17,7 +17,7 @@ src/corrupt-exif-1626.jpg : 256 x 256, 3 channel, uint8 jpeg XResolution: 300 YResolution: 300 jpeg:subsampling: "4:2:0" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" corrupt-icc-4551.jpg DCT coefficient (lossy) or spatial difference (lossless) out of range Reading src/corrupt-icc-4552.jpg @@ -43,4 +43,4 @@ src/corrupt-icc-4552.jpg : 1500 x 1000, 3 channel, uint8 jpeg ICCProfile:profile_version: "2.1.0" ICCProfile:rendering_intent: "Unknown" jpeg:subsampling: "4:2:0" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" diff --git a/testsuite/jpeg-metadata/ref/out.txt b/testsuite/jpeg-metadata/ref/out.txt index 86cee1f4ec..ed28e2c630 100644 --- a/testsuite/jpeg-metadata/ref/out.txt +++ b/testsuite/jpeg-metadata/ref/out.txt @@ -10,7 +10,7 @@ src/blender-render.jpg : 640 x 480, 3 channel, uint8 jpeg Blender:Scene: "Scene" Blender:Time: "00:00:00:01" jpeg:subsampling: "4:2:0" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Comparing "src/blender-render.jpg" and "no-attribs.jpg" PASS Reading no-attribs.jpg @@ -21,7 +21,7 @@ no-attribs.jpg : 640 x 480, 3 channel, uint8 jpeg Exif:ExifVersion: "0230" Exif:FlashPixVersion: "0100" jpeg:subsampling: "4:2:0" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Reading src/blender-render.jpg src/blender-render.jpg : 640 x 480, 3 channel, uint8 jpeg SHA-1: A60D05FC42FDEE2FC8907531E3641C17D7C1E3AB @@ -34,7 +34,7 @@ src/blender-render.jpg : 640 x 480, 3 channel, uint8 jpeg Blender:Scene: "Scene" Blender:Time: "00:00:00:01" jpeg:subsampling: "4:2:0" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Comparing "src/blender-render.jpg" and "with-attribs.jpg" PASS Reading with-attribs.jpg @@ -52,7 +52,7 @@ with-attribs.jpg : 640 x 480, 3 channel, uint8 jpeg Exif:ExifVersion: "0230" Exif:FlashPixVersion: "0100" jpeg:subsampling: "4:2:0" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Reading src/blender-render.jpg src/blender-render.jpg : 640 x 480, 3 channel, uint8 jpeg SHA-1: A60D05FC42FDEE2FC8907531E3641C17D7C1E3AB @@ -65,7 +65,7 @@ src/blender-render.jpg : 640 x 480, 3 channel, uint8 jpeg Blender:Scene: "Scene" Blender:Time: "00:00:00:01" jpeg:subsampling: "4:2:0" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Comparing "src/blender-render.jpg" and "with-attribs-and-desc.jpg" PASS Reading with-attribs-and-desc.jpg @@ -84,7 +84,7 @@ with-attribs-and-desc.jpg : 640 x 480, 3 channel, uint8 jpeg Exif:ExifVersion: "0230" Exif:FlashPixVersion: "0100" jpeg:subsampling: "4:2:0" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Reading src/blender-render.jpg src/blender-render.jpg : 640 x 480, 3 channel, uint8 jpeg SHA-1: A60D05FC42FDEE2FC8907531E3641C17D7C1E3AB @@ -97,7 +97,7 @@ src/blender-render.jpg : 640 x 480, 3 channel, uint8 jpeg Blender:Scene: "Scene" Blender:Time: "00:00:00:01" jpeg:subsampling: "4:2:0" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Comparing "src/blender-render.jpg" and "with-colon-desc.jpg" PASS Reading with-colon-desc.jpg @@ -109,4 +109,4 @@ with-colon-desc.jpg : 640 x 480, 3 channel, uint8 jpeg Exif:ExifVersion: "0230" Exif:FlashPixVersion: "0100" jpeg:subsampling: "4:2:0" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" diff --git a/testsuite/jpeg/ref/out.txt b/testsuite/jpeg/ref/out.txt index 442e464670..ddf8b31084 100644 --- a/testsuite/jpeg/ref/out.txt +++ b/testsuite/jpeg/ref/out.txt @@ -4,6 +4,6 @@ src/YCbCrK.jpg : 52 x 52, 3 channel, uint8 jpeg channel list: R, G, B jpeg:ColorSpace: "YCbCrK" jpeg:subsampling: "4:4:4" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Comparing "rgb-from-YCbCrK.tif" and "ref/rgb-from-YCbCrK.tif" PASS diff --git a/testsuite/jpeg2000-j2kp4files/ref/out-alt.txt b/testsuite/jpeg2000-j2kp4files/ref/out-alt.txt index f9db17bce9..90b81d01a7 100644 --- a/testsuite/jpeg2000-j2kp4files/ref/out-alt.txt +++ b/testsuite/jpeg2000-j2kp4files/ref/out-alt.txt @@ -3,7 +3,7 @@ Reading ../j2kp4files_v1_5/testfiles_jp2/file1.jp2 SHA-1: 746B1B44D0E5EE3999B1350B2A4245D679A617F7 channel list: R, G, B oiio:BitsPerSample: 8 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Comparing "../j2kp4files_v1_5/testfiles_jp2/file1.jp2" and "file1.jp2" PASS Reading ../j2kp4files_v1_5/testfiles_jp2/file2.jp2 @@ -11,7 +11,7 @@ Reading ../j2kp4files_v1_5/testfiles_jp2/file2.jp2 SHA-1: FB4746F0C4909CE8FED60C0179B70B2EEA0C0BA9 channel list: R, G, B oiio:BitsPerSample: 8 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Comparing "../j2kp4files_v1_5/testfiles_jp2/file2.jp2" and "file2.jp2" PASS Reading ../j2kp4files_v1_5/testfiles_jp2/file3.jp2 @@ -19,7 +19,7 @@ Reading ../j2kp4files_v1_5/testfiles_jp2/file3.jp2 SHA-1: B8A8FBF015263C072B051839F6BE645E7F27C671 channel list: R, G, B oiio:BitsPerSample: 8 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Comparing "../j2kp4files_v1_5/testfiles_jp2/file3.jp2" and "file3.jp2" PASS Reading ../j2kp4files_v1_5/testfiles_jp2/file4.jp2 @@ -27,7 +27,7 @@ Reading ../j2kp4files_v1_5/testfiles_jp2/file4.jp2 SHA-1: A45171430806BA3E74705675C855A781FC04BE44 channel list: Y oiio:BitsPerSample: 8 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Comparing "../j2kp4files_v1_5/testfiles_jp2/file4.jp2" and "file4.jp2" PASS Reading ../j2kp4files_v1_5/testfiles_jp2/file5.jp2 @@ -52,7 +52,7 @@ Reading ../j2kp4files_v1_5/testfiles_jp2/file5.jp2 ICCProfile:profile_version: "2.2.0" ICCProfile:rendering_intent: "Perceptual" oiio:BitsPerSample: 8 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Comparing "../j2kp4files_v1_5/testfiles_jp2/file5.jp2" and "file5.jp2" PASS Reading ../j2kp4files_v1_5/testfiles_jp2/file6.jp2 @@ -60,7 +60,7 @@ Reading ../j2kp4files_v1_5/testfiles_jp2/file6.jp2 SHA-1: 3A29DFAD0AA3F910AA2D37007989A4CC6E7BDE2A channel list: Y oiio:BitsPerSample: 12 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Comparing "../j2kp4files_v1_5/testfiles_jp2/file6.jp2" and "file6.jp2" PASS Reading ../j2kp4files_v1_5/testfiles_jp2/file7.jp2 @@ -87,7 +87,7 @@ Reading ../j2kp4files_v1_5/testfiles_jp2/file7.jp2 ICCProfile:profile_version: "2.1.0" ICCProfile:rendering_intent: "Perceptual" oiio:BitsPerSample: 16 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Comparing "../j2kp4files_v1_5/testfiles_jp2/file7.jp2" and "file7.jp2" PASS Reading ../j2kp4files_v1_5/testfiles_jp2/file8.jp2 @@ -112,7 +112,7 @@ Reading ../j2kp4files_v1_5/testfiles_jp2/file8.jp2 ICCProfile:profile_version: "2.2.0" ICCProfile:rendering_intent: "Perceptual" oiio:BitsPerSample: 8 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Comparing "../j2kp4files_v1_5/testfiles_jp2/file8.jp2" and "file8.jp2" PASS Reading ../j2kp4files_v1_5/testfiles_jp2/file9.jp2 @@ -120,6 +120,6 @@ Reading ../j2kp4files_v1_5/testfiles_jp2/file9.jp2 SHA-1: 501807547A6F9B8FA61EF7A4FD9AB7B369E7800C channel list: R, G, B oiio:BitsPerSample: 8 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Comparing "../j2kp4files_v1_5/testfiles_jp2/file9.jp2" and "file9.jp2" PASS diff --git a/testsuite/jpeg2000-j2kp4files/ref/out-spinux.txt b/testsuite/jpeg2000-j2kp4files/ref/out-spinux.txt index 7456d8abb3..0515e38e63 100644 --- a/testsuite/jpeg2000-j2kp4files/ref/out-spinux.txt +++ b/testsuite/jpeg2000-j2kp4files/ref/out-spinux.txt @@ -3,7 +3,7 @@ Reading ../j2kp4files_v1_5/testfiles_jp2/file1.jp2 SHA-1: 746B1B44D0E5EE3999B1350B2A4245D679A617F7 channel list: R, G, B oiio:BitsPerSample: 8 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Comparing "../j2kp4files_v1_5/testfiles_jp2/file1.jp2" and "file1.jp2" PASS Reading ../j2kp4files_v1_5/testfiles_jp2/file2.jp2 @@ -11,7 +11,7 @@ Reading ../j2kp4files_v1_5/testfiles_jp2/file2.jp2 SHA-1: FB4746F0C4909CE8FED60C0179B70B2EEA0C0BA9 channel list: R, G, B oiio:BitsPerSample: 8 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Comparing "../j2kp4files_v1_5/testfiles_jp2/file2.jp2" and "file2.jp2" PASS Reading ../j2kp4files_v1_5/testfiles_jp2/file3.jp2 @@ -19,7 +19,7 @@ Reading ../j2kp4files_v1_5/testfiles_jp2/file3.jp2 SHA-1: B8A8FBF015263C072B051839F6BE645E7F27C671 channel list: R, G, B oiio:BitsPerSample: 8 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Comparing "../j2kp4files_v1_5/testfiles_jp2/file3.jp2" and "file3.jp2" PASS Reading ../j2kp4files_v1_5/testfiles_jp2/file4.jp2 @@ -27,7 +27,7 @@ Reading ../j2kp4files_v1_5/testfiles_jp2/file4.jp2 SHA-1: A45171430806BA3E74705675C855A781FC04BE44 channel list: Y oiio:BitsPerSample: 8 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Comparing "../j2kp4files_v1_5/testfiles_jp2/file4.jp2" and "file4.jp2" PASS Reading ../j2kp4files_v1_5/testfiles_jp2/file5.jp2 @@ -52,7 +52,7 @@ Reading ../j2kp4files_v1_5/testfiles_jp2/file5.jp2 ICCProfile:profile_version: "2.2.0" ICCProfile:rendering_intent: "Perceptual" oiio:BitsPerSample: 8 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Comparing "../j2kp4files_v1_5/testfiles_jp2/file5.jp2" and "file5.jp2" PASS Reading ../j2kp4files_v1_5/testfiles_jp2/file6.jp2 @@ -60,7 +60,7 @@ Reading ../j2kp4files_v1_5/testfiles_jp2/file6.jp2 SHA-1: 3A29DFAD0AA3F910AA2D37007989A4CC6E7BDE2A channel list: Y oiio:BitsPerSample: 12 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Comparing "../j2kp4files_v1_5/testfiles_jp2/file6.jp2" and "file6.jp2" PASS Reading ../j2kp4files_v1_5/testfiles_jp2/file7.jp2 @@ -87,7 +87,7 @@ Reading ../j2kp4files_v1_5/testfiles_jp2/file7.jp2 ICCProfile:profile_version: "2.1.0" ICCProfile:rendering_intent: "Perceptual" oiio:BitsPerSample: 16 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Comparing "../j2kp4files_v1_5/testfiles_jp2/file7.jp2" and "file7.jp2" PASS Reading ../j2kp4files_v1_5/testfiles_jp2/file8.jp2 @@ -112,7 +112,7 @@ Reading ../j2kp4files_v1_5/testfiles_jp2/file8.jp2 ICCProfile:profile_version: "2.2.0" ICCProfile:rendering_intent: "Perceptual" oiio:BitsPerSample: 8 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Comparing "../j2kp4files_v1_5/testfiles_jp2/file8.jp2" and "file8.jp2" PASS Reading ../j2kp4files_v1_5/testfiles_jp2/file9.jp2 @@ -120,6 +120,6 @@ Reading ../j2kp4files_v1_5/testfiles_jp2/file9.jp2 SHA-1: 9784D248E95A47CDB3D0B260C7FBFFE2A4A2D492 channel list: Y oiio:BitsPerSample: 8 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Comparing "../j2kp4files_v1_5/testfiles_jp2/file9.jp2" and "file9.jp2" PASS diff --git a/testsuite/jpeg2000-j2kp4files/ref/out.txt b/testsuite/jpeg2000-j2kp4files/ref/out.txt index 4dff77ce4a..90c4454ce1 100644 --- a/testsuite/jpeg2000-j2kp4files/ref/out.txt +++ b/testsuite/jpeg2000-j2kp4files/ref/out.txt @@ -3,7 +3,7 @@ Reading ../j2kp4files_v1_5/testfiles_jp2/file1.jp2 SHA-1: 746B1B44D0E5EE3999B1350B2A4245D679A617F7 channel list: R, G, B oiio:BitsPerSample: 8 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Comparing "../j2kp4files_v1_5/testfiles_jp2/file1.jp2" and "file1.jp2" PASS Reading ../j2kp4files_v1_5/testfiles_jp2/file2.jp2 @@ -11,7 +11,7 @@ Reading ../j2kp4files_v1_5/testfiles_jp2/file2.jp2 SHA-1: 668A651D2B8C3B99CCCC560F993F5BBD33F2B3E7 channel list: R, G, B oiio:BitsPerSample: 8 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Comparing "../j2kp4files_v1_5/testfiles_jp2/file2.jp2" and "file2.jp2" PASS Reading ../j2kp4files_v1_5/testfiles_jp2/file3.jp2 @@ -19,7 +19,7 @@ Reading ../j2kp4files_v1_5/testfiles_jp2/file3.jp2 SHA-1: B8A8FBF015263C072B051839F6BE645E7F27C671 channel list: R, G, B oiio:BitsPerSample: 8 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Comparing "../j2kp4files_v1_5/testfiles_jp2/file3.jp2" and "file3.jp2" PASS Reading ../j2kp4files_v1_5/testfiles_jp2/file4.jp2 @@ -27,7 +27,7 @@ Reading ../j2kp4files_v1_5/testfiles_jp2/file4.jp2 SHA-1: A45171430806BA3E74705675C855A781FC04BE44 channel list: Y oiio:BitsPerSample: 8 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Comparing "../j2kp4files_v1_5/testfiles_jp2/file4.jp2" and "file4.jp2" PASS Reading ../j2kp4files_v1_5/testfiles_jp2/file5.jp2 @@ -52,7 +52,7 @@ Reading ../j2kp4files_v1_5/testfiles_jp2/file5.jp2 ICCProfile:profile_version: "2.2.0" ICCProfile:rendering_intent: "Perceptual" oiio:BitsPerSample: 8 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Comparing "../j2kp4files_v1_5/testfiles_jp2/file5.jp2" and "file5.jp2" PASS Reading ../j2kp4files_v1_5/testfiles_jp2/file6.jp2 @@ -60,7 +60,7 @@ Reading ../j2kp4files_v1_5/testfiles_jp2/file6.jp2 SHA-1: 3A29DFAD0AA3F910AA2D37007989A4CC6E7BDE2A channel list: Y oiio:BitsPerSample: 12 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Comparing "../j2kp4files_v1_5/testfiles_jp2/file6.jp2" and "file6.jp2" PASS Reading ../j2kp4files_v1_5/testfiles_jp2/file7.jp2 @@ -87,7 +87,7 @@ Reading ../j2kp4files_v1_5/testfiles_jp2/file7.jp2 ICCProfile:profile_version: "2.1.0" ICCProfile:rendering_intent: "Perceptual" oiio:BitsPerSample: 16 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Comparing "../j2kp4files_v1_5/testfiles_jp2/file7.jp2" and "file7.jp2" PASS Reading ../j2kp4files_v1_5/testfiles_jp2/file8.jp2 @@ -112,7 +112,7 @@ Reading ../j2kp4files_v1_5/testfiles_jp2/file8.jp2 ICCProfile:profile_version: "2.2.0" ICCProfile:rendering_intent: "Perceptual" oiio:BitsPerSample: 8 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Comparing "../j2kp4files_v1_5/testfiles_jp2/file8.jp2" and "file8.jp2" PASS Reading ../j2kp4files_v1_5/testfiles_jp2/file9.jp2 @@ -120,6 +120,6 @@ Reading ../j2kp4files_v1_5/testfiles_jp2/file9.jp2 SHA-1: 501807547A6F9B8FA61EF7A4FD9AB7B369E7800C channel list: R, G, B oiio:BitsPerSample: 8 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Comparing "../j2kp4files_v1_5/testfiles_jp2/file9.jp2" and "file9.jp2" PASS diff --git a/testsuite/oiiotool-attribs/ref/out-jpeg9d.txt b/testsuite/oiiotool-attribs/ref/out-jpeg9d.txt index 04737c6557..8976fe34b6 100644 --- a/testsuite/oiiotool-attribs/ref/out-jpeg9d.txt +++ b/testsuite/oiiotool-attribs/ref/out-jpeg9d.txt @@ -15,7 +15,7 @@ nomakegps.jpg : 2048 x 1536, 3 channel, uint8 jpeg Exif:WhiteBalance: 0 (auto) Exif:YCbCrPositioning: 1 jpeg:subsampling: "4:2:0" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Reading nomake.jpg nomake.jpg : 2048 x 1536, 3 channel, uint8 jpeg SHA-1: A74C7DF2B01825DCB6881407AE77C11DC56AB741 @@ -43,7 +43,7 @@ nomake.jpg : 2048 x 1536, 3 channel, uint8 jpeg GPS:TimeStamp: 17, 56, 33 GPS:VersionID: 2, 2, 0, 0 jpeg:subsampling: "4:2:0" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Reading nogps.jpg nogps.jpg : 2048 x 1536, 3 channel, uint8 jpeg SHA-1: A74C7DF2B01825DCB6881407AE77C11DC56AB741 @@ -62,13 +62,13 @@ nogps.jpg : 2048 x 1536, 3 channel, uint8 jpeg Exif:WhiteBalance: 0 (auto) Exif:YCbCrPositioning: 1 jpeg:subsampling: "4:2:0" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Reading noattribs.jpg noattribs.jpg : 2048 x 1536, 3 channel, uint8 jpeg SHA-1: A74C7DF2B01825DCB6881407AE77C11DC56AB741 channel list: R, G, B jpeg:subsampling: "4:2:0" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" initial keywords= after adding, keywords=foo; bar after clearing, keywords= @@ -156,7 +156,7 @@ tahoe-icc.jpg : 128 x 96, 3 channel, uint8 jpeg ICCProfile:profile_version: "2.1.0" ICCProfile:rendering_intent: "Perceptual" jpeg:subsampling: "4:2:0" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Reading tahoe-icc.webp tahoe-icc.webp : 128 x 96, 3 channel, uint8 webp SHA-1: 407D97F3D62F90C7F9A78AF85989ED3C06C59523 @@ -178,4 +178,4 @@ tahoe-icc.webp : 128 x 96, 3 channel, uint8 webp ICCProfile:profile_size: 560 ICCProfile:profile_version: "2.1.0" ICCProfile:rendering_intent: "Perceptual" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" diff --git a/testsuite/oiiotool-attribs/ref/out.txt b/testsuite/oiiotool-attribs/ref/out.txt index b51b530a60..24d84ebbf3 100644 --- a/testsuite/oiiotool-attribs/ref/out.txt +++ b/testsuite/oiiotool-attribs/ref/out.txt @@ -15,7 +15,7 @@ nomakegps.jpg : 2048 x 1536, 3 channel, uint8 jpeg Exif:WhiteBalance: 0 (auto) Exif:YCbCrPositioning: 1 jpeg:subsampling: "4:2:0" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Reading nomake.jpg nomake.jpg : 2048 x 1536, 3 channel, uint8 jpeg SHA-1: 2623446988E34395C6B0A4AA4FC75107C708BF18 @@ -43,7 +43,7 @@ nomake.jpg : 2048 x 1536, 3 channel, uint8 jpeg GPS:TimeStamp: 17, 56, 33 GPS:VersionID: 2, 2, 0, 0 jpeg:subsampling: "4:2:0" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Reading nogps.jpg nogps.jpg : 2048 x 1536, 3 channel, uint8 jpeg SHA-1: 2623446988E34395C6B0A4AA4FC75107C708BF18 @@ -62,13 +62,13 @@ nogps.jpg : 2048 x 1536, 3 channel, uint8 jpeg Exif:WhiteBalance: 0 (auto) Exif:YCbCrPositioning: 1 jpeg:subsampling: "4:2:0" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Reading noattribs.jpg noattribs.jpg : 2048 x 1536, 3 channel, uint8 jpeg SHA-1: 2623446988E34395C6B0A4AA4FC75107C708BF18 channel list: R, G, B jpeg:subsampling: "4:2:0" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" initial keywords= after adding, keywords=foo; bar after clearing, keywords= @@ -156,7 +156,7 @@ tahoe-icc.jpg : 128 x 96, 3 channel, uint8 jpeg ICCProfile:profile_version: "2.1.0" ICCProfile:rendering_intent: "Perceptual" jpeg:subsampling: "4:2:0" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Reading tahoe-icc.webp tahoe-icc.webp : 128 x 96, 3 channel, uint8 webp SHA-1: 407D97F3D62F90C7F9A78AF85989ED3C06C59523 @@ -178,4 +178,4 @@ tahoe-icc.webp : 128 x 96, 3 channel, uint8 webp ICCProfile:profile_size: 560 ICCProfile:profile_version: "2.1.0" ICCProfile:rendering_intent: "Perceptual" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" diff --git a/testsuite/png/ref/out-libpng15.txt b/testsuite/png/ref/out-libpng15.txt index 2c46ae17af..1591efdfa1 100644 --- a/testsuite/png/ref/out-libpng15.txt +++ b/testsuite/png/ref/out-libpng15.txt @@ -7,7 +7,7 @@ Reading ../oiio-images/png/oiio-logo-no-alpha.png ResolutionUnit: "inch" XResolution: 72 YResolution: 72 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Comparing "../oiio-images/png/oiio-logo-no-alpha.png" and "oiio-logo-no-alpha.png" PASS Reading ../oiio-images/png/oiio-logo-with-alpha.png @@ -19,7 +19,7 @@ Reading ../oiio-images/png/oiio-logo-with-alpha.png ResolutionUnit: "inch" XResolution: 72 YResolution: 72 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Comparing "../oiio-images/png/oiio-logo-with-alpha.png" and "oiio-logo-with-alpha.png" PASS Reading exif.png @@ -30,7 +30,7 @@ exif.png : 64 x 64, 3 channel, uint8 png Exif:FlashPixVersion: "0100" Exif:FocalLength: 45.7 (45.7 mm) Exif:WhiteBalance: 0 (auto) - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" alphagamma: 1 x 1, 4 channel, float png channel list: R, G, B, A @@ -78,7 +78,7 @@ gimp_gradient: ICCProfile:profile_size: 672 ICCProfile:profile_version: "4.4.0" ICCProfile:rendering_intent: "Perceptual" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Stats Min: 0 0 0 0 (of 255) Stats Max: 255 255 0 255 (of 255) Stats Avg: 142.37 105.72 0.00 154.72 (of 255) @@ -93,14 +93,35 @@ smallalpha.png : 1 x 1, 4 channel, uint8 png cicp: 16 x 16, 4 channel, float png channel list: R, G, B, A - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" removed_cicp: 16 x 16, 4 channel, float png channel list: R, G, B, A - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" remove_cicp_via_set_colorspace: 16 x 16, 4 channel, float png channel list: R, G, B, A oiio:ColorSpace: "g22_rec709_display" +Reading g22_rec709_display.png +g22_rec709_display.png : 64 x 64, 3 channel, uint8 png + SHA-1: 7CB41FEA50720B48BE0C145E1473982B23E9AB77 + channel list: R, G, B + oiio:ColorSpace: "g22_rec709_display" +Reading g22_rec709_scene.png +g22_rec709_scene.png : 64 x 64, 3 channel, uint8 png + SHA-1: 7CB41FEA50720B48BE0C145E1473982B23E9AB77 + channel list: R, G, B + oiio:ColorSpace: "g22_rec709_scene" + oiio:Gamma: 2.2 +Reading test16.png +test16.png : 16 x 16, 4 channel, uint16 png + SHA-1: 6BDC50A9C1C3E9735D95A08B410FF893AA767415 + channel list: R, G, B, A + oiio:ColorSpace: "srgb_rec709_display" +Reading test16.png +test16.png : 16 x 16, 4 channel, uint16 png + SHA-1: 6BDC50A9C1C3E9735D95A08B410FF893AA767415 + channel list: R, G, B, A + oiio:ColorSpace: "srgb_rec709_display" Comparing "test16.png" and "ref/test16.png" PASS diff --git a/testsuite/png/ref/out.txt b/testsuite/png/ref/out.txt index 49b9933234..466e98bda3 100644 --- a/testsuite/png/ref/out.txt +++ b/testsuite/png/ref/out.txt @@ -7,7 +7,7 @@ Reading ../oiio-images/png/oiio-logo-no-alpha.png ResolutionUnit: "inch" XResolution: 72 YResolution: 72 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Comparing "../oiio-images/png/oiio-logo-no-alpha.png" and "oiio-logo-no-alpha.png" PASS Reading ../oiio-images/png/oiio-logo-with-alpha.png @@ -19,7 +19,7 @@ Reading ../oiio-images/png/oiio-logo-with-alpha.png ResolutionUnit: "inch" XResolution: 72 YResolution: 72 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Comparing "../oiio-images/png/oiio-logo-with-alpha.png" and "oiio-logo-with-alpha.png" PASS Reading exif.png @@ -30,7 +30,7 @@ exif.png : 64 x 64, 3 channel, uint8 png Exif:FlashPixVersion: "0100" Exif:FocalLength: 45.7 (45.7 mm) Exif:WhiteBalance: 0 (auto) - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" alphagamma: 1 x 1, 4 channel, float png channel list: R, G, B, A @@ -78,7 +78,7 @@ gimp_gradient: ICCProfile:profile_size: 672 ICCProfile:profile_version: "4.4.0" ICCProfile:rendering_intent: "Perceptual" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Stats Min: 0 0 0 0 (of 255) Stats Max: 255 255 0 255 (of 255) Stats Avg: 142.37 105.72 0.00 154.72 (of 255) @@ -94,14 +94,37 @@ cicp: 16 x 16, 4 channel, float png channel list: R, G, B, A CICP: 1, 13, 0, 1 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" removed_cicp: 16 x 16, 4 channel, float png channel list: R, G, B, A - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" remove_cicp_via_set_colorspace: 16 x 16, 4 channel, float png channel list: R, G, B, A oiio:ColorSpace: "g22_rec709_display" +Reading g22_rec709_display.png +g22_rec709_display.png : 64 x 64, 3 channel, uint8 png + SHA-1: 7CB41FEA50720B48BE0C145E1473982B23E9AB77 + channel list: R, G, B + oiio:ColorSpace: "g22_rec709_display" +Reading g22_rec709_scene.png +g22_rec709_scene.png : 64 x 64, 3 channel, uint8 png + SHA-1: 7CB41FEA50720B48BE0C145E1473982B23E9AB77 + channel list: R, G, B + oiio:ColorSpace: "g22_rec709_scene" + oiio:Gamma: 2.2 +Reading test16.png +test16.png : 16 x 16, 4 channel, uint16 png + SHA-1: 6BDC50A9C1C3E9735D95A08B410FF893AA767415 + channel list: R, G, B, A + CICP: 1, 13, 0, 1 + oiio:ColorSpace: "srgb_rec709_scene" +Reading test16.png +test16.png : 16 x 16, 4 channel, uint16 png + SHA-1: 6BDC50A9C1C3E9735D95A08B410FF893AA767415 + channel list: R, G, B, A + CICP: 1, 13, 0, 1 + oiio:ColorSpace: "srgb_rec709_display" Comparing "test16.png" and "ref/test16.png" PASS diff --git a/testsuite/png/run.py b/testsuite/png/run.py index 7fc357b29c..3e2ed1caef 100755 --- a/testsuite/png/run.py +++ b/testsuite/png/run.py @@ -43,4 +43,14 @@ # Test that "set_colorspace" removes CICP metadata command += oiiotool ("-echo remove_cicp_via_set_colorspace: test16.png --eraseattrib Software --cicp 1,13 --iscolorspace g22_rec709_display --printinfo") +# Test g22_rec709_display being written as sRGB +command += oiiotool ("--create 64x64 3 --iscolorspace g22_rec709_display -o g22_rec709_display.png") +command += oiiotool ("--create 64x64 3 --iscolorspace g22_rec709_scene -o g22_rec709_scene.png") +command += info_command ("g22_rec709_display.png", safematch=True) +command += info_command ("g22_rec709_scene.png", safematch=True) + +# Teset preference for scene referred color space +command += info_command ("--oiioattrib color:prefer_image_state scene test16.png", safematch=True) +command += info_command ("--oiioattrib color:prefer_image_state display test16.png", safematch=True) + outputs = [ "test16.png", "out.txt" ] diff --git a/testsuite/psd/ref/out-linuxarm.txt b/testsuite/psd/ref/out-linuxarm.txt index 0928d038b1..914740df96 100644 --- a/testsuite/psd/ref/out-linuxarm.txt +++ b/testsuite/psd/ref/out-linuxarm.txt @@ -42,7 +42,7 @@ Reading ../oiio-images/psd/psd_123.psd IPTC:MetadataDate: "2011-08-22T22:14:43-04:00" IPTC:ModifyDate: "2011-08-22T22:14:43-04:00" IPTC:OriginalDocumentID: "xmp.did:047A91A22BCDE011A998CBE7B5CCEB92" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" photoshop:LayerName: 1, 2, 3 @@ -91,7 +91,7 @@ Reading ../oiio-images/psd/psd_123.psd IPTC:MetadataDate: "2011-08-22T22:14:43-04:00" IPTC:ModifyDate: "2011-08-22T22:14:43-04:00" IPTC:OriginalDocumentID: "xmp.did:047A91A22BCDE011A998CBE7B5CCEB92" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" oiio:subimagename: "1" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" @@ -141,7 +141,7 @@ Reading ../oiio-images/psd/psd_123.psd IPTC:MetadataDate: "2011-08-22T22:14:43-04:00" IPTC:ModifyDate: "2011-08-22T22:14:43-04:00" IPTC:OriginalDocumentID: "xmp.did:047A91A22BCDE011A998CBE7B5CCEB92" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" oiio:subimagename: "2" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" @@ -191,7 +191,7 @@ Reading ../oiio-images/psd/psd_123.psd IPTC:MetadataDate: "2011-08-22T22:14:43-04:00" IPTC:ModifyDate: "2011-08-22T22:14:43-04:00" IPTC:OriginalDocumentID: "xmp.did:047A91A22BCDE011A998CBE7B5CCEB92" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" oiio:subimagename: "3" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" @@ -246,7 +246,7 @@ Reading ../oiio-images/psd/psd_123_nomaxcompat.psd IPTC:MetadataDate: "2011-08-29T12:10:28-04:00" IPTC:ModifyDate: "2011-08-29T12:10:28-04:00" IPTC:OriginalDocumentID: "xmp.did:047A91A22BCDE011A998CBE7B5CCEB92" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" photoshop:LayerName: 1, 2, 3 @@ -296,7 +296,7 @@ Reading ../oiio-images/psd/psd_123_nomaxcompat.psd IPTC:MetadataDate: "2011-08-29T12:10:28-04:00" IPTC:ModifyDate: "2011-08-29T12:10:28-04:00" IPTC:OriginalDocumentID: "xmp.did:047A91A22BCDE011A998CBE7B5CCEB92" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" oiio:subimagename: "1" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" @@ -347,7 +347,7 @@ Reading ../oiio-images/psd/psd_123_nomaxcompat.psd IPTC:MetadataDate: "2011-08-29T12:10:28-04:00" IPTC:ModifyDate: "2011-08-29T12:10:28-04:00" IPTC:OriginalDocumentID: "xmp.did:047A91A22BCDE011A998CBE7B5CCEB92" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" oiio:subimagename: "2" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" @@ -398,7 +398,7 @@ Reading ../oiio-images/psd/psd_123_nomaxcompat.psd IPTC:MetadataDate: "2011-08-29T12:10:28-04:00" IPTC:ModifyDate: "2011-08-29T12:10:28-04:00" IPTC:OriginalDocumentID: "xmp.did:047A91A22BCDE011A998CBE7B5CCEB92" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" oiio:subimagename: "3" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" @@ -555,7 +555,7 @@ Reading ../oiio-images/psd/psd_indexed_trans.psd IPTC:MetadataDate: "2011-08-29T11:54:09-04:00" IPTC:ModifyDate: "2011-08-29T11:54:09-04:00" IPTC:OriginalDocumentID: "E146B3E37A92795EE3EA6577040DE6D5" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" photoshop:ColorMode: 2 photoshop:ICCProfile: "sRGB IEC61966-2.1" rdf:parseType: "Resource" @@ -645,7 +645,7 @@ Reading ../oiio-images/psd/psd_rgb_8.psd IPTC:MetadataDate: "2011-08-25T17:40-04:00" IPTC:ModifyDate: "2011-08-25T17:40-04:00" IPTC:OriginalDocumentID: "E146B3E37A92795EE3EA6577040DE6D5" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" rdf:parseType: "Resource" @@ -735,7 +735,7 @@ Reading ../oiio-images/psd/psd_rgb_16.psd IPTC:MetadataDate: "2011-08-25T17:39:49-04:00" IPTC:ModifyDate: "2011-08-25T17:39:49-04:00" IPTC:OriginalDocumentID: "E146B3E37A92795EE3EA6577040DE6D5" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" rdf:parseType: "Resource" @@ -878,7 +878,7 @@ Reading ../oiio-images/psd/psd_rgba_8.psd IPTC:MetadataDate: "2011-08-25T17:39:28-04:00" IPTC:ModifyDate: "2011-08-25T17:39:28-04:00" IPTC:OriginalDocumentID: "xmp.did:037A91A22BCDE011A998CBE7B5CCEB92" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" rdf:parseType: "Resource" @@ -925,7 +925,7 @@ Reading ../oiio-images/psd/psd_rgba_8.psd IPTC:MetadataDate: "2011-08-25T17:39:28-04:00" IPTC:ModifyDate: "2011-08-25T17:39:28-04:00" IPTC:OriginalDocumentID: "xmp.did:037A91A22BCDE011A998CBE7B5CCEB92" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" oiio:subimagename: "Layer 1" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" @@ -1025,7 +1025,7 @@ Reading ../oiio-images/psd/psd_123.psd IPTC:MetadataDate: "2011-08-22T22:14:43-04:00" IPTC:ModifyDate: "2011-08-22T22:14:43-04:00" IPTC:OriginalDocumentID: "xmp.did:047A91A22BCDE011A998CBE7B5CCEB92" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" oiio:UnassociatedAlpha: 1 photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" @@ -1075,7 +1075,7 @@ Reading ../oiio-images/psd/psd_123.psd IPTC:MetadataDate: "2011-08-22T22:14:43-04:00" IPTC:ModifyDate: "2011-08-22T22:14:43-04:00" IPTC:OriginalDocumentID: "xmp.did:047A91A22BCDE011A998CBE7B5CCEB92" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" oiio:subimagename: "1" oiio:UnassociatedAlpha: 1 photoshop:ColorMode: 3 @@ -1126,7 +1126,7 @@ Reading ../oiio-images/psd/psd_123.psd IPTC:MetadataDate: "2011-08-22T22:14:43-04:00" IPTC:ModifyDate: "2011-08-22T22:14:43-04:00" IPTC:OriginalDocumentID: "xmp.did:047A91A22BCDE011A998CBE7B5CCEB92" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" oiio:subimagename: "2" oiio:UnassociatedAlpha: 1 photoshop:ColorMode: 3 @@ -1177,7 +1177,7 @@ Reading ../oiio-images/psd/psd_123.psd IPTC:MetadataDate: "2011-08-22T22:14:43-04:00" IPTC:ModifyDate: "2011-08-22T22:14:43-04:00" IPTC:OriginalDocumentID: "xmp.did:047A91A22BCDE011A998CBE7B5CCEB92" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" oiio:subimagename: "3" oiio:UnassociatedAlpha: 1 photoshop:ColorMode: 3 @@ -1230,7 +1230,7 @@ src/different-mask-size.psd : 30 x 90, 3 channel, uint8 psd IPTC:MetadataDate: "2017-01-10T17:55:32+09:00" IPTC:ModifyDate: "2017-01-10T17:55:32+09:00" IPTC:OriginalDocumentID: "xmp.did:e5390921-47bd-41b6-9237-d4903a41e966" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" rdf:parseType: "Resource" @@ -1277,7 +1277,7 @@ src/different-mask-size.psd : 30 x 90, 3 channel, uint8 psd IPTC:MetadataDate: "2017-01-10T17:55:32+09:00" IPTC:ModifyDate: "2017-01-10T17:55:32+09:00" IPTC:OriginalDocumentID: "xmp.did:e5390921-47bd-41b6-9237-d4903a41e966" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" oiio:subimagename: "Layer 0" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" @@ -1326,7 +1326,7 @@ src/different-mask-size.psd : 30 x 90, 3 channel, uint8 psd IPTC:MetadataDate: "2017-01-10T17:55:32+09:00" IPTC:ModifyDate: "2017-01-10T17:55:32+09:00" IPTC:OriginalDocumentID: "xmp.did:e5390921-47bd-41b6-9237-d4903a41e966" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" oiio:subimagename: "line1" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" @@ -1375,7 +1375,7 @@ src/different-mask-size.psd : 30 x 90, 3 channel, uint8 psd IPTC:MetadataDate: "2017-01-10T17:55:32+09:00" IPTC:ModifyDate: "2017-01-10T17:55:32+09:00" IPTC:OriginalDocumentID: "xmp.did:e5390921-47bd-41b6-9237-d4903a41e966" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" oiio:subimagename: "line2" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" @@ -1522,7 +1522,7 @@ src/Layers_8bit_RGB.psd : 48 x 27, 3 channel, uint8 psd IPTC:MetadataDate: "2024-04-01T19:35:40+02:00" IPTC:ModifyDate: "2024-04-01T19:35:40+02:00" IPTC:OriginalDocumentID: "xmp.did:68fcb000-4377-c148-974d-bdd193ca024d" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" rdf:parseType: "Resource" @@ -1573,7 +1573,7 @@ src/Layers_8bit_RGB.psd : 48 x 27, 3 channel, uint8 psd IPTC:MetadataDate: "2024-04-01T19:35:40+02:00" IPTC:ModifyDate: "2024-04-01T19:35:40+02:00" IPTC:OriginalDocumentID: "xmp.did:68fcb000-4377-c148-974d-bdd193ca024d" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" oiio:subimagename: "Blue_Lagoon" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" @@ -1625,7 +1625,7 @@ src/Layers_8bit_RGB.psd : 48 x 27, 3 channel, uint8 psd IPTC:MetadataDate: "2024-04-01T19:35:40+02:00" IPTC:ModifyDate: "2024-04-01T19:35:40+02:00" IPTC:OriginalDocumentID: "xmp.did:68fcb000-4377-c148-974d-bdd193ca024d" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" oiio:subimagename: "Layer" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" @@ -1677,7 +1677,7 @@ src/Layers_8bit_RGB.psd : 48 x 27, 3 channel, uint8 psd IPTC:MetadataDate: "2024-04-01T19:35:40+02:00" IPTC:ModifyDate: "2024-04-01T19:35:40+02:00" IPTC:OriginalDocumentID: "xmp.did:68fcb000-4377-c148-974d-bdd193ca024d" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" oiio:subimagename: "Layer2" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" @@ -1735,7 +1735,7 @@ src/Layers_16bit_RGB.psd : 48 x 27, 3 channel, uint16 psd IPTC:MetadataDate: "2024-04-01T19:35:30+02:00" IPTC:ModifyDate: "2024-04-01T19:35:30+02:00" IPTC:OriginalDocumentID: "xmp.did:68fcb000-4377-c148-974d-bdd193ca024d" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" rdf:parseType: "Resource" @@ -1786,7 +1786,7 @@ src/Layers_16bit_RGB.psd : 48 x 27, 3 channel, uint16 psd IPTC:MetadataDate: "2024-04-01T19:35:30+02:00" IPTC:ModifyDate: "2024-04-01T19:35:30+02:00" IPTC:OriginalDocumentID: "xmp.did:68fcb000-4377-c148-974d-bdd193ca024d" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" oiio:subimagename: "Blue_Lagoon" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" @@ -1838,7 +1838,7 @@ src/Layers_16bit_RGB.psd : 48 x 27, 3 channel, uint16 psd IPTC:MetadataDate: "2024-04-01T19:35:30+02:00" IPTC:ModifyDate: "2024-04-01T19:35:30+02:00" IPTC:OriginalDocumentID: "xmp.did:68fcb000-4377-c148-974d-bdd193ca024d" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" oiio:subimagename: "Layer" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" @@ -1890,7 +1890,7 @@ src/Layers_16bit_RGB.psd : 48 x 27, 3 channel, uint16 psd IPTC:MetadataDate: "2024-04-01T19:35:30+02:00" IPTC:ModifyDate: "2024-04-01T19:35:30+02:00" IPTC:OriginalDocumentID: "xmp.did:68fcb000-4377-c148-974d-bdd193ca024d" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" oiio:subimagename: "Layer2" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" diff --git a/testsuite/psd/ref/out.txt b/testsuite/psd/ref/out.txt index b5cc8594d7..54fd8f3529 100644 --- a/testsuite/psd/ref/out.txt +++ b/testsuite/psd/ref/out.txt @@ -42,7 +42,7 @@ Reading ../oiio-images/psd/psd_123.psd IPTC:MetadataDate: "2011-08-22T22:14:43-04:00" IPTC:ModifyDate: "2011-08-22T22:14:43-04:00" IPTC:OriginalDocumentID: "xmp.did:047A91A22BCDE011A998CBE7B5CCEB92" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" photoshop:LayerName: 1, 2, 3 @@ -91,7 +91,7 @@ Reading ../oiio-images/psd/psd_123.psd IPTC:MetadataDate: "2011-08-22T22:14:43-04:00" IPTC:ModifyDate: "2011-08-22T22:14:43-04:00" IPTC:OriginalDocumentID: "xmp.did:047A91A22BCDE011A998CBE7B5CCEB92" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" oiio:subimagename: "1" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" @@ -141,7 +141,7 @@ Reading ../oiio-images/psd/psd_123.psd IPTC:MetadataDate: "2011-08-22T22:14:43-04:00" IPTC:ModifyDate: "2011-08-22T22:14:43-04:00" IPTC:OriginalDocumentID: "xmp.did:047A91A22BCDE011A998CBE7B5CCEB92" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" oiio:subimagename: "2" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" @@ -191,7 +191,7 @@ Reading ../oiio-images/psd/psd_123.psd IPTC:MetadataDate: "2011-08-22T22:14:43-04:00" IPTC:ModifyDate: "2011-08-22T22:14:43-04:00" IPTC:OriginalDocumentID: "xmp.did:047A91A22BCDE011A998CBE7B5CCEB92" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" oiio:subimagename: "3" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" @@ -246,7 +246,7 @@ Reading ../oiio-images/psd/psd_123_nomaxcompat.psd IPTC:MetadataDate: "2011-08-29T12:10:28-04:00" IPTC:ModifyDate: "2011-08-29T12:10:28-04:00" IPTC:OriginalDocumentID: "xmp.did:047A91A22BCDE011A998CBE7B5CCEB92" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" photoshop:LayerName: 1, 2, 3 @@ -296,7 +296,7 @@ Reading ../oiio-images/psd/psd_123_nomaxcompat.psd IPTC:MetadataDate: "2011-08-29T12:10:28-04:00" IPTC:ModifyDate: "2011-08-29T12:10:28-04:00" IPTC:OriginalDocumentID: "xmp.did:047A91A22BCDE011A998CBE7B5CCEB92" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" oiio:subimagename: "1" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" @@ -347,7 +347,7 @@ Reading ../oiio-images/psd/psd_123_nomaxcompat.psd IPTC:MetadataDate: "2011-08-29T12:10:28-04:00" IPTC:ModifyDate: "2011-08-29T12:10:28-04:00" IPTC:OriginalDocumentID: "xmp.did:047A91A22BCDE011A998CBE7B5CCEB92" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" oiio:subimagename: "2" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" @@ -398,7 +398,7 @@ Reading ../oiio-images/psd/psd_123_nomaxcompat.psd IPTC:MetadataDate: "2011-08-29T12:10:28-04:00" IPTC:ModifyDate: "2011-08-29T12:10:28-04:00" IPTC:OriginalDocumentID: "xmp.did:047A91A22BCDE011A998CBE7B5CCEB92" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" oiio:subimagename: "3" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" @@ -555,7 +555,7 @@ Reading ../oiio-images/psd/psd_indexed_trans.psd IPTC:MetadataDate: "2011-08-29T11:54:09-04:00" IPTC:ModifyDate: "2011-08-29T11:54:09-04:00" IPTC:OriginalDocumentID: "E146B3E37A92795EE3EA6577040DE6D5" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" photoshop:ColorMode: 2 photoshop:ICCProfile: "sRGB IEC61966-2.1" rdf:parseType: "Resource" @@ -645,7 +645,7 @@ Reading ../oiio-images/psd/psd_rgb_8.psd IPTC:MetadataDate: "2011-08-25T17:40-04:00" IPTC:ModifyDate: "2011-08-25T17:40-04:00" IPTC:OriginalDocumentID: "E146B3E37A92795EE3EA6577040DE6D5" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" rdf:parseType: "Resource" @@ -735,7 +735,7 @@ Reading ../oiio-images/psd/psd_rgb_16.psd IPTC:MetadataDate: "2011-08-25T17:39:49-04:00" IPTC:ModifyDate: "2011-08-25T17:39:49-04:00" IPTC:OriginalDocumentID: "E146B3E37A92795EE3EA6577040DE6D5" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" rdf:parseType: "Resource" @@ -878,7 +878,7 @@ Reading ../oiio-images/psd/psd_rgba_8.psd IPTC:MetadataDate: "2011-08-25T17:39:28-04:00" IPTC:ModifyDate: "2011-08-25T17:39:28-04:00" IPTC:OriginalDocumentID: "xmp.did:037A91A22BCDE011A998CBE7B5CCEB92" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" rdf:parseType: "Resource" @@ -925,7 +925,7 @@ Reading ../oiio-images/psd/psd_rgba_8.psd IPTC:MetadataDate: "2011-08-25T17:39:28-04:00" IPTC:ModifyDate: "2011-08-25T17:39:28-04:00" IPTC:OriginalDocumentID: "xmp.did:037A91A22BCDE011A998CBE7B5CCEB92" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" oiio:subimagename: "Layer 1" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" @@ -1025,7 +1025,7 @@ Reading ../oiio-images/psd/psd_123.psd IPTC:MetadataDate: "2011-08-22T22:14:43-04:00" IPTC:ModifyDate: "2011-08-22T22:14:43-04:00" IPTC:OriginalDocumentID: "xmp.did:047A91A22BCDE011A998CBE7B5CCEB92" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" oiio:UnassociatedAlpha: 1 photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" @@ -1075,7 +1075,7 @@ Reading ../oiio-images/psd/psd_123.psd IPTC:MetadataDate: "2011-08-22T22:14:43-04:00" IPTC:ModifyDate: "2011-08-22T22:14:43-04:00" IPTC:OriginalDocumentID: "xmp.did:047A91A22BCDE011A998CBE7B5CCEB92" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" oiio:subimagename: "1" oiio:UnassociatedAlpha: 1 photoshop:ColorMode: 3 @@ -1126,7 +1126,7 @@ Reading ../oiio-images/psd/psd_123.psd IPTC:MetadataDate: "2011-08-22T22:14:43-04:00" IPTC:ModifyDate: "2011-08-22T22:14:43-04:00" IPTC:OriginalDocumentID: "xmp.did:047A91A22BCDE011A998CBE7B5CCEB92" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" oiio:subimagename: "2" oiio:UnassociatedAlpha: 1 photoshop:ColorMode: 3 @@ -1177,7 +1177,7 @@ Reading ../oiio-images/psd/psd_123.psd IPTC:MetadataDate: "2011-08-22T22:14:43-04:00" IPTC:ModifyDate: "2011-08-22T22:14:43-04:00" IPTC:OriginalDocumentID: "xmp.did:047A91A22BCDE011A998CBE7B5CCEB92" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" oiio:subimagename: "3" oiio:UnassociatedAlpha: 1 photoshop:ColorMode: 3 @@ -1230,7 +1230,7 @@ src/different-mask-size.psd : 30 x 90, 3 channel, uint8 psd IPTC:MetadataDate: "2017-01-10T17:55:32+09:00" IPTC:ModifyDate: "2017-01-10T17:55:32+09:00" IPTC:OriginalDocumentID: "xmp.did:e5390921-47bd-41b6-9237-d4903a41e966" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" rdf:parseType: "Resource" @@ -1277,7 +1277,7 @@ src/different-mask-size.psd : 30 x 90, 3 channel, uint8 psd IPTC:MetadataDate: "2017-01-10T17:55:32+09:00" IPTC:ModifyDate: "2017-01-10T17:55:32+09:00" IPTC:OriginalDocumentID: "xmp.did:e5390921-47bd-41b6-9237-d4903a41e966" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" oiio:subimagename: "Layer 0" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" @@ -1326,7 +1326,7 @@ src/different-mask-size.psd : 30 x 90, 3 channel, uint8 psd IPTC:MetadataDate: "2017-01-10T17:55:32+09:00" IPTC:ModifyDate: "2017-01-10T17:55:32+09:00" IPTC:OriginalDocumentID: "xmp.did:e5390921-47bd-41b6-9237-d4903a41e966" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" oiio:subimagename: "line1" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" @@ -1375,7 +1375,7 @@ src/different-mask-size.psd : 30 x 90, 3 channel, uint8 psd IPTC:MetadataDate: "2017-01-10T17:55:32+09:00" IPTC:ModifyDate: "2017-01-10T17:55:32+09:00" IPTC:OriginalDocumentID: "xmp.did:e5390921-47bd-41b6-9237-d4903a41e966" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" oiio:subimagename: "line2" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" @@ -1522,7 +1522,7 @@ src/Layers_8bit_RGB.psd : 48 x 27, 3 channel, uint8 psd IPTC:MetadataDate: "2024-04-01T19:35:40+02:00" IPTC:ModifyDate: "2024-04-01T19:35:40+02:00" IPTC:OriginalDocumentID: "xmp.did:68fcb000-4377-c148-974d-bdd193ca024d" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" rdf:parseType: "Resource" @@ -1573,7 +1573,7 @@ src/Layers_8bit_RGB.psd : 48 x 27, 3 channel, uint8 psd IPTC:MetadataDate: "2024-04-01T19:35:40+02:00" IPTC:ModifyDate: "2024-04-01T19:35:40+02:00" IPTC:OriginalDocumentID: "xmp.did:68fcb000-4377-c148-974d-bdd193ca024d" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" oiio:subimagename: "Blue_Lagoon" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" @@ -1625,7 +1625,7 @@ src/Layers_8bit_RGB.psd : 48 x 27, 3 channel, uint8 psd IPTC:MetadataDate: "2024-04-01T19:35:40+02:00" IPTC:ModifyDate: "2024-04-01T19:35:40+02:00" IPTC:OriginalDocumentID: "xmp.did:68fcb000-4377-c148-974d-bdd193ca024d" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" oiio:subimagename: "Layer" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" @@ -1677,7 +1677,7 @@ src/Layers_8bit_RGB.psd : 48 x 27, 3 channel, uint8 psd IPTC:MetadataDate: "2024-04-01T19:35:40+02:00" IPTC:ModifyDate: "2024-04-01T19:35:40+02:00" IPTC:OriginalDocumentID: "xmp.did:68fcb000-4377-c148-974d-bdd193ca024d" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" oiio:subimagename: "Layer2" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" @@ -1735,7 +1735,7 @@ src/Layers_16bit_RGB.psd : 48 x 27, 3 channel, uint16 psd IPTC:MetadataDate: "2024-04-01T19:35:30+02:00" IPTC:ModifyDate: "2024-04-01T19:35:30+02:00" IPTC:OriginalDocumentID: "xmp.did:68fcb000-4377-c148-974d-bdd193ca024d" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" rdf:parseType: "Resource" @@ -1786,7 +1786,7 @@ src/Layers_16bit_RGB.psd : 48 x 27, 3 channel, uint16 psd IPTC:MetadataDate: "2024-04-01T19:35:30+02:00" IPTC:ModifyDate: "2024-04-01T19:35:30+02:00" IPTC:OriginalDocumentID: "xmp.did:68fcb000-4377-c148-974d-bdd193ca024d" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" oiio:subimagename: "Blue_Lagoon" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" @@ -1838,7 +1838,7 @@ src/Layers_16bit_RGB.psd : 48 x 27, 3 channel, uint16 psd IPTC:MetadataDate: "2024-04-01T19:35:30+02:00" IPTC:ModifyDate: "2024-04-01T19:35:30+02:00" IPTC:OriginalDocumentID: "xmp.did:68fcb000-4377-c148-974d-bdd193ca024d" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" oiio:subimagename: "Layer" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" @@ -1890,7 +1890,7 @@ src/Layers_16bit_RGB.psd : 48 x 27, 3 channel, uint16 psd IPTC:MetadataDate: "2024-04-01T19:35:30+02:00" IPTC:ModifyDate: "2024-04-01T19:35:30+02:00" IPTC:OriginalDocumentID: "xmp.did:68fcb000-4377-c148-974d-bdd193ca024d" - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" oiio:subimagename: "Layer2" photoshop:ColorMode: 3 photoshop:ICCProfile: "sRGB IEC61966-2.1" diff --git a/testsuite/python-colorconfig/ref/out-ocio23.txt b/testsuite/python-colorconfig/ref/out-ocio23.txt index 1badffcb7f..5993d20733 100644 --- a/testsuite/python-colorconfig/ref/out-ocio23.txt +++ b/testsuite/python-colorconfig/ref/out-ocio23.txt @@ -1,8 +1,8 @@ -getNumColorSpaces = 15 -getColorSpaceNames = ['ACES2065-1', 'ACEScc', 'ACEScct', 'ACEScg', 'Linear P3-D65', 'Linear Rec.2020', 'Linear Rec.709 (sRGB)', 'Gamma 1.8 Rec.709 - Texture', 'Gamma 2.2 AP1 - Texture', 'Gamma 2.2 Rec.709 - Texture', 'Gamma 2.4 Rec.709 - Texture', 'sRGB Encoded AP1 - Texture', 'sRGB Encoded P3-D65 - Texture', 'sRGB - Texture', 'Raw'] -Index of 'lin_srgb' = 6 +getNumColorSpaces = 22 +getColorSpaceNames = ['CIE-XYZ-D65', 'sRGB - Display', 'Display P3 - Display', 'Rec.1886 Rec.709 - Display', 'Rec.2100-PQ - Display', 'ST2084-P3-D65 - Display', 'P3-D65 - Display', 'ACES2065-1', 'ACEScc', 'ACEScct', 'ACEScg', 'Linear P3-D65', 'Linear Rec.2020', 'Linear Rec.709 (sRGB)', 'Gamma 1.8 Rec.709 - Texture', 'Gamma 2.2 AP1 - Texture', 'Gamma 2.2 Rec.709 - Texture', 'Gamma 2.4 Rec.709 - Texture', 'sRGB Encoded AP1 - Texture', 'sRGB Encoded P3-D65 - Texture', 'sRGB - Texture', 'Raw'] +Index of 'lin_srgb' = 13 Index of 'unknown' = -1 -Name of color space 2 = ACEScct +Name of color space 2 = Display P3 - Display getNumLooks = 1 getLookNames = ['ACES 1.3 Reference Gamut Compression'] getNumDisplays = 6 @@ -18,7 +18,7 @@ resolve('foo'): foo resolve('linear'): Linear Rec.709 (sRGB) resolve('scene_linear'): ACEScg resolve('lin_srgb'): Linear Rec.709 (sRGB) -resolve('srgb'): sRGB - Texture +resolve('srgb'): sRGB - Display resolve('ACEScg'): ACEScg equivalent('lin_srgb', 'srgb'): False equivalent('scene_linear', 'srgb'): False @@ -28,7 +28,7 @@ equivalent('ACEScg', 'scene_linear'): True equivalent('lnf', 'scene_linear'): False get_color_interop_id('ACEScg') = lin_ap1_scene get_color_interop_id('lin_srgb') = lin_rec709_scene -get_color_interop_id([1, 13, 1, 1]) = srgb_rec709_scene +get_color_interop_id([1, 13, 1, 1]) = srgb_rec709_display get_cicp('pq_rec2020_display') = [9, 16, 9, 1] get_cicp('unknown_interop_id') = None diff --git a/testsuite/python-colorconfig/ref/out-ocio24.txt b/testsuite/python-colorconfig/ref/out-ocio24.txt index 2882859127..0c49ae4440 100644 --- a/testsuite/python-colorconfig/ref/out-ocio24.txt +++ b/testsuite/python-colorconfig/ref/out-ocio24.txt @@ -1,8 +1,8 @@ -getNumColorSpaces = 23 -getColorSpaceNames = ['sRGB - Display', 'Display P3 - Display', 'Rec.1886 Rec.709 - Display', 'Rec.2100-PQ - Display', 'ST2084-P3-D65 - Display', 'P3-D65 - Display', 'ACES2065-1', 'ACEScc', 'ACEScct', 'ACEScg', 'sRGB Encoded Rec.709 (sRGB)', 'Gamma 1.8 Encoded Rec.709', 'Gamma 2.2 Encoded Rec.709', 'Gamma 2.4 Encoded Rec.709', 'sRGB Encoded P3-D65', 'Gamma 2.2 Encoded AdobeRGB', 'sRGB Encoded AP1', 'Gamma 2.2 Encoded AP1', 'Linear Rec.709 (sRGB)', 'Linear P3-D65', 'Linear AdobeRGB', 'Linear Rec.2020', 'Raw'] -Index of 'lin_srgb' = 18 +getNumColorSpaces = 25 +getColorSpaceNames = ['CIE XYZ-D65 - Display-referred', 'sRGB - Display', 'Display P3 - Display', 'Rec.1886 Rec.709 - Display', 'Rec.2100-PQ - Display', 'ST2084-P3-D65 - Display', 'P3-D65 - Display', 'ACES2065-1', 'ACEScc', 'ACEScct', 'ACEScg', 'sRGB Encoded Rec.709 (sRGB)', 'Gamma 1.8 Encoded Rec.709', 'Gamma 2.2 Encoded Rec.709', 'Gamma 2.4 Encoded Rec.709', 'sRGB Encoded P3-D65', 'Gamma 2.2 Encoded AdobeRGB', 'sRGB Encoded AP1', 'Gamma 2.2 Encoded AP1', 'Linear Rec.709 (sRGB)', 'Linear P3-D65', 'Linear AdobeRGB', 'Linear Rec.2020', 'CIE XYZ-D65 - Scene-referred', 'Raw'] +Index of 'lin_srgb' = 19 Index of 'unknown' = -1 -Name of color space 2 = Rec.1886 Rec.709 - Display +Name of color space 2 = Display P3 - Display getNumLooks = 1 getLookNames = ['ACES 1.3 Reference Gamut Compression'] getNumDisplays = 6 @@ -18,7 +18,7 @@ resolve('foo'): foo resolve('linear'): Linear Rec.709 (sRGB) resolve('scene_linear'): ACEScg resolve('lin_srgb'): Linear Rec.709 (sRGB) -resolve('srgb'): sRGB Encoded Rec.709 (sRGB) +resolve('srgb'): sRGB - Display resolve('ACEScg'): ACEScg equivalent('lin_srgb', 'srgb'): False equivalent('scene_linear', 'srgb'): False @@ -28,7 +28,7 @@ equivalent('ACEScg', 'scene_linear'): True equivalent('lnf', 'scene_linear'): False get_color_interop_id('ACEScg') = lin_ap1_scene get_color_interop_id('lin_srgb') = lin_rec709_scene -get_color_interop_id([1, 13, 1, 1]) = srgb_rec709_scene +get_color_interop_id([1, 13, 1, 1]) = srgb_rec709_display get_cicp('pq_rec2020_display') = [9, 16, 9, 1] get_cicp('unknown_interop_id') = None diff --git a/testsuite/python-colorconfig/ref/out-ocio25.txt b/testsuite/python-colorconfig/ref/out-ocio25.txt index b12d8ce08d..0840a3563a 100644 --- a/testsuite/python-colorconfig/ref/out-ocio25.txt +++ b/testsuite/python-colorconfig/ref/out-ocio25.txt @@ -1,8 +1,8 @@ -getNumColorSpaces = 25 -getColorSpaceNames = ['sRGB - Display', 'Gamma 2.2 Rec.709 - Display', 'Display P3 - Display', 'Display P3 HDR - Display', 'P3-D65 - Display', 'Rec.1886 Rec.709 - Display', 'Rec.2100-PQ - Display', 'ST2084-P3-D65 - Display', 'ACES2065-1', 'ACEScc', 'ACEScct', 'ACEScg', 'sRGB Encoded Rec.709 (sRGB)', 'Gamma 1.8 Encoded Rec.709', 'Gamma 2.2 Encoded Rec.709', 'Gamma 2.4 Encoded Rec.709', 'sRGB Encoded P3-D65', 'Gamma 2.2 Encoded AdobeRGB', 'sRGB Encoded AP1', 'Gamma 2.2 Encoded AP1', 'Linear AdobeRGB', 'Linear P3-D65', 'Linear Rec.2020', 'Linear Rec.709 (sRGB)', 'Raw'] -Index of 'lin_srgb' = 23 +getNumColorSpaces = 27 +getColorSpaceNames = ['CIE XYZ-D65 - Display-referred', 'sRGB - Display', 'Gamma 2.2 Rec.709 - Display', 'Display P3 - Display', 'Display P3 HDR - Display', 'P3-D65 - Display', 'Rec.1886 Rec.709 - Display', 'Rec.2100-PQ - Display', 'ST2084-P3-D65 - Display', 'ACES2065-1', 'ACEScc', 'ACEScct', 'ACEScg', 'sRGB Encoded Rec.709 (sRGB)', 'Gamma 1.8 Encoded Rec.709', 'Gamma 2.2 Encoded Rec.709', 'Gamma 2.4 Encoded Rec.709', 'sRGB Encoded P3-D65', 'Gamma 2.2 Encoded AdobeRGB', 'sRGB Encoded AP1', 'Gamma 2.2 Encoded AP1', 'CIE XYZ-D65 - Scene-referred', 'Linear AdobeRGB', 'Linear P3-D65', 'Linear Rec.2020', 'Linear Rec.709 (sRGB)', 'Raw'] +Index of 'lin_srgb' = 25 Index of 'unknown' = -1 -Name of color space 2 = Display P3 - Display +Name of color space 2 = Gamma 2.2 Rec.709 - Display getNumLooks = 1 getLookNames = ['ACES 1.3 Reference Gamut Compression'] getNumDisplays = 8 @@ -18,7 +18,7 @@ resolve('foo'): foo resolve('linear'): Linear Rec.709 (sRGB) resolve('scene_linear'): ACEScg resolve('lin_srgb'): Linear Rec.709 (sRGB) -resolve('srgb'): sRGB Encoded Rec.709 (sRGB) +resolve('srgb'): sRGB - Display resolve('ACEScg'): ACEScg equivalent('lin_srgb', 'srgb'): False equivalent('scene_linear', 'srgb'): False @@ -28,7 +28,7 @@ equivalent('ACEScg', 'scene_linear'): True equivalent('lnf', 'scene_linear'): False get_color_interop_id('ACEScg') = lin_ap1_scene get_color_interop_id('lin_srgb') = lin_rec709_scene -get_color_interop_id([1, 13, 1, 1]) = srgb_rec709_scene +get_color_interop_id([1, 13, 1, 1]) = srgb_rec709_display get_cicp('pq_rec2020_display') = [9, 16, 9, 1] get_cicp('unknown_interop_id') = None diff --git a/testsuite/python-colorconfig/ref/out.txt b/testsuite/python-colorconfig/ref/out.txt index cb9a3dddfc..fa013c175b 100644 --- a/testsuite/python-colorconfig/ref/out.txt +++ b/testsuite/python-colorconfig/ref/out.txt @@ -18,7 +18,7 @@ resolve('foo'): foo resolve('linear'): Linear Rec.709 (sRGB) resolve('scene_linear'): ACEScg resolve('lin_srgb'): Linear Rec.709 (sRGB) -resolve('srgb'): sRGB - Texture +resolve('srgb'): sRGB - Display resolve('ACEScg'): ACEScg equivalent('lin_srgb', 'srgb'): False equivalent('scene_linear', 'srgb'): False @@ -28,7 +28,7 @@ equivalent('ACEScg', 'scene_linear'): True equivalent('lnf', 'scene_linear'): False get_color_interop_id('ACEScg') = lin_ap1_scene get_color_interop_id('lin_srgb') = lin_rec709_scene -get_color_interop_id([1, 13, 1, 1]) = srgb_rec709_scene +get_color_interop_id([1, 13, 1, 1]) = srgb_rec709_display get_cicp('pq_rec2020_display') = [9, 16, 9, 1] get_cicp('unknown_interop_id') = None diff --git a/testsuite/python-imageinput/ref/out-alt.txt b/testsuite/python-imageinput/ref/out-alt.txt index 7183df6b78..4daec38117 100644 --- a/testsuite/python-imageinput/ref/out-alt.txt +++ b/testsuite/python-imageinput/ref/out-alt.txt @@ -8,7 +8,7 @@ Opened "../oiio-images/tahoe-gps.jpg" as a jpeg alpha channel = -1 z channel = -1 deep = False - oiio:ColorSpace = "srgb_rec709_scene" + oiio:ColorSpace = "srgb_rec709_display" jpeg:subsampling = "4:2:0" Make = "HTC" Model = "T-Mobile G1" diff --git a/testsuite/python-imageinput/ref/out-alt2.txt b/testsuite/python-imageinput/ref/out-alt2.txt index a3eed8e9a5..473658c122 100644 --- a/testsuite/python-imageinput/ref/out-alt2.txt +++ b/testsuite/python-imageinput/ref/out-alt2.txt @@ -8,7 +8,7 @@ Opened "../oiio-images/tahoe-gps.jpg" as a jpeg alpha channel = -1 z channel = -1 deep = False - oiio:ColorSpace = "srgb_rec709_scene" + oiio:ColorSpace = "srgb_rec709_display" jpeg:subsampling = "4:2:0" Make = "HTC" Model = "T-Mobile G1" diff --git a/testsuite/python-imageinput/ref/out-py37-jpeg9d.txt b/testsuite/python-imageinput/ref/out-py37-jpeg9d.txt index 246c484257..13540fdd81 100644 --- a/testsuite/python-imageinput/ref/out-py37-jpeg9d.txt +++ b/testsuite/python-imageinput/ref/out-py37-jpeg9d.txt @@ -8,7 +8,7 @@ Opened "../oiio-images/tahoe-gps.jpg" as a jpeg alpha channel = -1 z channel = -1 deep = False - oiio:ColorSpace = "srgb_rec709_scene" + oiio:ColorSpace = "srgb_rec709_display" jpeg:subsampling = "4:2:0" Make = "HTC" Model = "T-Mobile G1" diff --git a/testsuite/python-imageinput/ref/out-python3-win-2.txt b/testsuite/python-imageinput/ref/out-python3-win-2.txt index 3420ab62a8..2505a7773f 100644 --- a/testsuite/python-imageinput/ref/out-python3-win-2.txt +++ b/testsuite/python-imageinput/ref/out-python3-win-2.txt @@ -8,7 +8,7 @@ Opened "C:/a/OpenImageIO/OpenImageIO/build/testsuite/oiio-images/tahoe-gps.jpg" alpha channel = -1 z channel = -1 deep = False - oiio:ColorSpace = "srgb_rec709_scene" + oiio:ColorSpace = "srgb_rec709_display" jpeg:subsampling = "4:2:0" Make = "HTC" Model = "T-Mobile G1" diff --git a/testsuite/python-imageinput/ref/out-python3-win.txt b/testsuite/python-imageinput/ref/out-python3-win.txt index 0f08533526..a79f07cbad 100644 --- a/testsuite/python-imageinput/ref/out-python3-win.txt +++ b/testsuite/python-imageinput/ref/out-python3-win.txt @@ -8,7 +8,7 @@ Opened "D:/a/OpenImageIO/OpenImageIO/build/testsuite/oiio-images/tahoe-gps.jpg" alpha channel = -1 z channel = -1 deep = False - oiio:ColorSpace = "srgb_rec709_scene" + oiio:ColorSpace = "srgb_rec709_display" jpeg:subsampling = "4:2:0" Make = "HTC" Model = "T-Mobile G1" diff --git a/testsuite/python-imageinput/ref/out-python3.txt b/testsuite/python-imageinput/ref/out-python3.txt index 0d15bac4b0..39eba77df0 100644 --- a/testsuite/python-imageinput/ref/out-python3.txt +++ b/testsuite/python-imageinput/ref/out-python3.txt @@ -8,7 +8,7 @@ Opened "../oiio-images/tahoe-gps.jpg" as a jpeg alpha channel = -1 z channel = -1 deep = False - oiio:ColorSpace = "srgb_rec709_scene" + oiio:ColorSpace = "srgb_rec709_display" jpeg:subsampling = "4:2:0" Make = "HTC" Model = "T-Mobile G1" diff --git a/testsuite/python-imageinput/ref/out.txt b/testsuite/python-imageinput/ref/out.txt index a3eed8e9a5..473658c122 100644 --- a/testsuite/python-imageinput/ref/out.txt +++ b/testsuite/python-imageinput/ref/out.txt @@ -8,7 +8,7 @@ Opened "../oiio-images/tahoe-gps.jpg" as a jpeg alpha channel = -1 z channel = -1 deep = False - oiio:ColorSpace = "srgb_rec709_scene" + oiio:ColorSpace = "srgb_rec709_display" jpeg:subsampling = "4:2:0" Make = "HTC" Model = "T-Mobile G1" diff --git a/testsuite/tiff-suite/ref/out-alt.txt b/testsuite/tiff-suite/ref/out-alt.txt index 20a7ce2efb..81b4b48ccd 100644 --- a/testsuite/tiff-suite/ref/out-alt.txt +++ b/testsuite/tiff-suite/ref/out-alt.txt @@ -81,7 +81,7 @@ Reading ../oiio-images/libtiffpic/dscf0013.tif Exif:ShutterSpeedValue: 6.5 (1/90 s) Exif:YCbCrPositioning: 2 oiio:BitsPerSample: 8 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" tiff:ColorSpace: "YCbCr" tiff:Compression: 1 tiff:PhotometricInterpretation: 6 @@ -251,7 +251,7 @@ Reading ../oiio-images/libtiffpic/pc260001.tif Exif:Sharpness: 2 (hard) Exif:WhiteBalance: 0 (auto) oiio:BitsPerSample: 8 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" tiff:Compression: 1 tiff:PhotometricInterpretation: 2 tiff:PlanarConfiguration: 1 diff --git a/testsuite/tiff-suite/ref/out-alt2.txt b/testsuite/tiff-suite/ref/out-alt2.txt index 3a14b41bc5..1bbaa84091 100644 --- a/testsuite/tiff-suite/ref/out-alt2.txt +++ b/testsuite/tiff-suite/ref/out-alt2.txt @@ -81,7 +81,7 @@ Reading ../oiio-images/libtiffpic/dscf0013.tif Exif:ShutterSpeedValue: 6.5 (1/90 s) Exif:YCbCrPositioning: 2 oiio:BitsPerSample: 8 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" tiff:ColorSpace: "YCbCr" tiff:Compression: 1 tiff:PhotometricInterpretation: 6 @@ -251,7 +251,7 @@ Reading ../oiio-images/libtiffpic/pc260001.tif Exif:Sharpness: 2 (hard) Exif:WhiteBalance: 0 (auto) oiio:BitsPerSample: 8 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" tiff:Compression: 1 tiff:PhotometricInterpretation: 2 tiff:PlanarConfiguration: 1 diff --git a/testsuite/tiff-suite/ref/out-jpeg9b.txt b/testsuite/tiff-suite/ref/out-jpeg9b.txt index 354a70c52e..357de2005e 100644 --- a/testsuite/tiff-suite/ref/out-jpeg9b.txt +++ b/testsuite/tiff-suite/ref/out-jpeg9b.txt @@ -81,7 +81,7 @@ Reading ../oiio-images/libtiffpic/dscf0013.tif Exif:ShutterSpeedValue: 6.5 (1/90 s) Exif:YCbCrPositioning: 2 oiio:BitsPerSample: 8 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" tiff:ColorSpace: "YCbCr" tiff:Compression: 1 tiff:PhotometricInterpretation: 6 @@ -251,7 +251,7 @@ Reading ../oiio-images/libtiffpic/pc260001.tif Exif:Sharpness: 2 (hard) Exif:WhiteBalance: 0 (auto) oiio:BitsPerSample: 8 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" tiff:Compression: 1 tiff:PhotometricInterpretation: 2 tiff:PlanarConfiguration: 1 diff --git a/testsuite/tiff-suite/ref/out-jpeg9d-alt.txt b/testsuite/tiff-suite/ref/out-jpeg9d-alt.txt index fb5da67d19..77b238aaf6 100644 --- a/testsuite/tiff-suite/ref/out-jpeg9d-alt.txt +++ b/testsuite/tiff-suite/ref/out-jpeg9d-alt.txt @@ -81,7 +81,7 @@ Reading ../oiio-images/libtiffpic/dscf0013.tif Exif:ShutterSpeedValue: 6.5 (1/90 s) Exif:YCbCrPositioning: 2 oiio:BitsPerSample: 8 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" tiff:ColorSpace: "YCbCr" tiff:Compression: 1 tiff:PhotometricInterpretation: 6 @@ -251,7 +251,7 @@ Reading ../oiio-images/libtiffpic/pc260001.tif Exif:Sharpness: 2 (hard) Exif:WhiteBalance: 0 (auto) oiio:BitsPerSample: 8 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" tiff:Compression: 1 tiff:PhotometricInterpretation: 2 tiff:PlanarConfiguration: 1 diff --git a/testsuite/tiff-suite/ref/out.txt b/testsuite/tiff-suite/ref/out.txt index 30a318664a..6225e913af 100644 --- a/testsuite/tiff-suite/ref/out.txt +++ b/testsuite/tiff-suite/ref/out.txt @@ -81,7 +81,7 @@ Reading ../oiio-images/libtiffpic/dscf0013.tif Exif:ShutterSpeedValue: 6.5 (1/90 s) Exif:YCbCrPositioning: 2 oiio:BitsPerSample: 8 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" tiff:ColorSpace: "YCbCr" tiff:Compression: 1 tiff:PhotometricInterpretation: 6 @@ -251,7 +251,7 @@ Reading ../oiio-images/libtiffpic/pc260001.tif Exif:Sharpness: 2 (hard) Exif:WhiteBalance: 0 (auto) oiio:BitsPerSample: 8 - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" tiff:Compression: 1 tiff:PhotometricInterpretation: 2 tiff:PlanarConfiguration: 1 diff --git a/testsuite/webp/ref/out-webp1.1.txt b/testsuite/webp/ref/out-webp1.1.txt index f7e0d095de..ec7114c508 100644 --- a/testsuite/webp/ref/out-webp1.1.txt +++ b/testsuite/webp/ref/out-webp1.1.txt @@ -2,19 +2,19 @@ Reading ../oiio-images/webp/1.webp ../oiio-images/webp/1.webp : 550 x 368, 3 channel, uint8 webp SHA-1: C8D715F7E492E94E29FFF0E605E0F00F1892FC7A channel list: R, G, B - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Reading ../oiio-images/webp/2.webp ../oiio-images/webp/2.webp : 550 x 404, 3 channel, uint8 webp SHA-1: 6679CBF3655C40A6ECE9188DDC136BE18599C138 channel list: R, G, B - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Reading ../oiio-images/webp/3.webp ../oiio-images/webp/3.webp : 1280 x 720, 3 channel, uint8 webp SHA-1: AC77455077A5C8E9271B16FCB3A3E520CBA42018 channel list: R, G, B - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" Reading ../oiio-images/webp/4.webp ../oiio-images/webp/4.webp : 1024 x 772, 3 channel, uint8 webp SHA-1: 8F42E3DCCE6FE15146BA06C440C15B7831F60572 channel list: R, G, B - oiio:ColorSpace: "srgb_rec709_scene" + oiio:ColorSpace: "srgb_rec709_display" From 934de7205c80e29f19e94faf79dd3abcad03ef45 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Mon, 15 Dec 2025 11:04:41 +0100 Subject: [PATCH 3/4] Address comments, update docs to discourage using "sRGB" colorspace Signed-off-by: Brecht Van Lommel --- src/doc/builtinplugins.rst | 3 ++- src/doc/imagebufalgo.rst | 15 +++++++++------ src/doc/pythonbindings.rst | 5 +++-- src/doc/stdmetadata.rst | 3 ++- src/include/OpenImageIO/imageio.h | 8 ++++---- src/libOpenImageIO/color_ocio.cpp | 11 ++++++----- src/raw.imageio/rawinput.cpp | 5 ++--- 7 files changed, 28 insertions(+), 22 deletions(-) diff --git a/src/doc/builtinplugins.rst b/src/doc/builtinplugins.rst index f6eea37efd..5cb8128b12 100644 --- a/src/doc/builtinplugins.rst +++ b/src/doc/builtinplugins.rst @@ -60,7 +60,8 @@ tiles. - Version of the BMP file format * - ``oiio:ColorSpace`` - string - - currently, it is always ``"sRGB"`` (we presume all BMP files are sRGB) + - currently, it is always ``"srgb_rec709_display"`` or + ``"srgb_rec709_scene"`` (we presume all BMP files are sRGB) **Configuration settings for BMP input** diff --git a/src/doc/imagebufalgo.rst b/src/doc/imagebufalgo.rst index b013ce0d20..ec9b752100 100644 --- a/src/doc/imagebufalgo.rst +++ b/src/doc/imagebufalgo.rst @@ -2849,12 +2849,14 @@ Color space conversion .. code-tab:: c++ ImageBuf Src ("tahoe.jpg"); - ImageBuf Dst = ImageBufAlgo::colorconvert (Src, "sRGB", "acescg", true); + ImageBuf Dst = ImageBufAlgo::colorconvert (Src, "srgb_rec709_scene", + "acescg", true); .. code-tab:: py Src = ImageBuf("tahoe.jpg") - Dst = ImageBufAlgo.colorconvert (Src, "sRGB", "acescg", True) + Dst = ImageBufAlgo.colorconvert (Src, "srgb_rec709_scene", "acescg", + True) .. code-tab:: bash oiiotool @@ -2950,14 +2952,15 @@ Color space conversion .. code-tab:: c++ ImageBuf Src ("tahoe.exr"); - ImageBuf Dst = ImageBufAlgo::ociodisplay (Src, "sRGB", "Film", "lnf", - "", true, "SHOT", "pe0012"); + ImageBuf Dst = ImageBufAlgo::ociodisplay (Src, "srgb_rec709_scene", + "Film", "lnf", "", true, + "SHOT", "pe0012"); .. code-tab:: py Src = ImageBuf("tahoe.jpg") - Dst = ImageBufAlgo.ociodisplay (Src, "sRGB", "Film", "lnf", - "", True, "SHOT", "pe0012") + Dst = ImageBufAlgo.ociodisplay (Src, "srgb_rec709_scene", "Film", + "lnf", "", True, "SHOT", "pe0012") .. code-tab:: bash oiiotool diff --git a/src/doc/pythonbindings.rst b/src/doc/pythonbindings.rst index d07735eed2..4eb7e563ba 100644 --- a/src/doc/pythonbindings.rst +++ b/src/doc/pythonbindings.rst @@ -3610,7 +3610,8 @@ Color manipulation .. code-block:: python Src = ImageBuf ("tahoe.jpg") - Dst = ImageBufAlgo.colorconvert (Src, "sRGB", "scene_linear") + Dst = ImageBufAlgo.colorconvert (Src, "srgb_rec709_scene", + "scene_linear") @@ -3660,7 +3661,7 @@ Color manipulation .. code-block:: python Src = ImageBuf ("tahoe.exr") - Dst = ImageBufAlgo.ociodisplay (Src, "sRGB", "Film", "lnf", + Dst = ImageBufAlgo.ociodisplay (Src, "srgb_rec709_scene", "Film", "lnf", context_key="SHOT", context_value="pe0012") diff --git a/src/doc/stdmetadata.rst b/src/doc/stdmetadata.rst index 51e56cab8f..9e537100a9 100644 --- a/src/doc/stdmetadata.rst +++ b/src/doc/stdmetadata.rst @@ -150,7 +150,8 @@ Color information - `"lin_ap0_scene"` : ACES2065-1, the recommended ACES space for interchange and archiving. - `"srgb_rec709_display"` : Using standard (piecewise) sRGB response and - primaries. The token `"sRGB"` is treated as a synonym. + primaries. The token `"sRGB"` is treated as a synonym, but it is + recommended to use the more specific interop ID. - `"srgb_rec709_scene"` : Same response and primaries as `"srgb_rec709_display"` but for scene referred images. - `"g22_rec709_display"` : Rec709/sRGB primaries, but using a response curve diff --git a/src/include/OpenImageIO/imageio.h b/src/include/OpenImageIO/imageio.h index d8194b52ed..d5d8731782 100644 --- a/src/include/OpenImageIO/imageio.h +++ b/src/include/OpenImageIO/imageio.h @@ -912,10 +912,10 @@ class OIIO_API ImageSpec { /// 1. Assigning to the delegate adds a metadata attribute: /// /// ImageSpec spec; - /// spec["foo"] = 42; // int - /// spec["pi"] = float(M_PI); // float - /// spec["oiio:ColorSpace"] = "sRGB"; // string - /// spec["cameratoworld"] = Imath::Matrix44(...); // matrix + /// spec["foo"] = 42; // int + /// spec["pi"] = float(M_PI); // float + /// spec["oiio:ColorSpace"] = "srgb_rec709_display"; // string + /// spec["cameratoworld"] = Imath::Matrix44(...); // matrix /// /// Be very careful, the attribute's type will be implied by the C++ /// type of what you assign. diff --git a/src/libOpenImageIO/color_ocio.cpp b/src/libOpenImageIO/color_ocio.cpp index e760fe6029..a64b7520cd 100644 --- a/src/libOpenImageIO/color_ocio.cpp +++ b/src/libOpenImageIO/color_ocio.cpp @@ -2100,7 +2100,8 @@ struct ColorInteropID { // Mapping between color interop ID and CICP, based on Color Interop Forum // recommendations. constexpr ColorInteropID color_interop_ids[] = { - // Display referred interop IDs. + // Display referred interop IDs first so they are the default in automatic. + // conversion from CICP to interop ID. { "srgb_rec709_display", CICPPrimaries::Rec709, CICPTransfer::sRGB, CICPMatrix::BT709 }, // Not all software interprets this CICP the same, see the @@ -2137,9 +2138,9 @@ constexpr ColorInteropID color_interop_ids[] = { { "ocio:lin_ciexyzd65_display", CICPPrimaries::XYZD65, CICPTransfer::Linear, CICPMatrix::Unspecified }, - // Scene referred interop IDs first so they are the default in automatic - // conversion from CICP to interop ID. Some are not display color spaces - // at all, but can be represented by CICP anyway. + // Scene referred interop IDs. These have CICPs even if it can be argued + // those are only meant for display color spaces. It still improves interop + // with other software that does not care about the distinction. { "lin_ap1_scene" }, { "lin_ap0_scene" }, { "lin_rec709_scene", CICPPrimaries::Rec709, CICPTransfer::Linear, @@ -2199,7 +2200,7 @@ string_view ColorConfig::get_color_interop_id(const int cicp[4], const string_view prefer_image_state) const { - string_view other_interop_id; + string_view other_interop_id = ""; for (const ColorInteropID& interop : color_interop_ids) { if (interop.has_cicp && interop.cicp[0] == cicp[0] && interop.cicp[1] == cicp[1]) { diff --git a/src/raw.imageio/rawinput.cpp b/src/raw.imageio/rawinput.cpp index a87773032c..7d818dcf0c 100644 --- a/src/raw.imageio/rawinput.cpp +++ b/src/raw.imageio/rawinput.cpp @@ -578,8 +578,7 @@ RawInput::open_raw(bool unpack, bool process, const std::string& name, m_processor->imgdata.params.gamm[0] = 1.0; m_processor->imgdata.params.gamm[1] = 1.0; } else if (cs.empty() || colorconfig.equivalent(cs, "srgb_rec709_display") - || colorconfig.equivalent(cs, "srgb_rec709_scene") - || Strutil::iequals(cs, "sRGB") /* Necessary? */) { + || colorconfig.equivalent(cs, "srgb_rec709_scene")) { // Request explicit sRGB, including usual sRGB response m_processor->imgdata.params.output_color = 1; m_processor->imgdata.params.gamm[0] = 1.0 / 2.4; @@ -589,7 +588,7 @@ RawInput::open_raw(bool unpack, bool process, const std::string& name, || Strutil::iequals(cs, "lin_srgb") || Strutil::iequals(cs, "lin_rec709") || Strutil::iequals(cs, "linear") /* DEPRECATED */) { - // Request "sRGB" primaries, linear response + // Request sRGB primaries, linear response m_processor->imgdata.params.output_color = 1; m_processor->imgdata.params.gamm[0] = 1.0; m_processor->imgdata.params.gamm[1] = 1.0; From 3a23e94155decc101c4377e70e2053c67c234a6f Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Mon, 15 Dec 2025 20:45:21 +0100 Subject: [PATCH 4/4] Set "sRGB" as alias for "srgb_rec709_scene" again Signed-off-by: Brecht Van Lommel --- src/libOpenImageIO/color_ocio.cpp | 16 ++++++++-------- testsuite/python-colorconfig/ref/out-ocio23.txt | 2 +- testsuite/python-colorconfig/ref/out-ocio24.txt | 2 +- testsuite/python-colorconfig/ref/out-ocio25.txt | 2 +- testsuite/python-colorconfig/ref/out.txt | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/libOpenImageIO/color_ocio.cpp b/src/libOpenImageIO/color_ocio.cpp index a64b7520cd..d3758127d8 100644 --- a/src/libOpenImageIO/color_ocio.cpp +++ b/src/libOpenImageIO/color_ocio.cpp @@ -483,7 +483,7 @@ ColorConfig::Impl::inventory() add("lin_rec709", 0, linflags); add("srgb_rec709_display", 1, CSInfo::is_srgb_display); add("srgb_rec709_scene", 1, CSInfo::is_srgb_scene); - add("sRGB", 1, CSInfo::is_srgb_display); + add("sRGB", 1, CSInfo::is_srgb_scene); add("Rec709", 2, CSInfo::is_Rec709); for (auto&& cs : colorspaces) @@ -600,14 +600,14 @@ ColorConfig::Impl::classify_by_name(CSInfo& cs) // if (Strutil::iequals(cs.name, "srgb_rec709_display") || Strutil::iequals(cs.name, "srgb_display") - || Strutil::iequals(cs.name, "sRGB - Display") - || Strutil::iequals(cs.name, "sRGB")) { + || Strutil::iequals(cs.name, "sRGB - Display")) { cs.setflag(CSInfo::is_srgb_display, srgb_display_alias); } else if (Strutil::iequals(cs.name, "srgb_rec709_scene") || Strutil::iequals(cs.name, "srgb_tx") || Strutil::iequals(cs.name, "srgb_texture") || Strutil::iequals(cs.name, "srgb texture") - || Strutil::iequals(cs.name, "sRGB - Texture")) { + || Strutil::iequals(cs.name, "sRGB - Texture") + || Strutil::iequals(cs.name, "sRGB")) { cs.setflag(CSInfo::is_srgb_scene, srgb_scene_alias); } else if (Strutil::iequals(cs.name, "lin_rec709_scene") || Strutil::iequals(cs.name, "lin_rec709") @@ -1386,12 +1386,12 @@ ColorConfig::Impl::resolve(string_view name) const // Maybe it's an informal alias of common names? spin_rw_write_lock lock(m_mutex); if ((Strutil::iequals(name, "sRGB") - || Strutil::iequals(name, "srgb_rec709_display")) - && !srgb_display_alias.empty()) - return srgb_display_alias; - if (Strutil::iequals(name, "srgb_rec709_scene") + || Strutil::iequals(name, "srgb_rec709_scene")) && !srgb_scene_alias.empty()) return srgb_scene_alias; + if (Strutil::iequals(name, "srgb_rec709_display") + && !srgb_display_alias.empty()) + return srgb_display_alias; if ((Strutil::iequals(name, "lin_srgb") || Strutil::iequals(name, "lin_rec709") || Strutil::iequals(name, "lin_rec709_scene") diff --git a/testsuite/python-colorconfig/ref/out-ocio23.txt b/testsuite/python-colorconfig/ref/out-ocio23.txt index 5993d20733..d40eb53a7c 100644 --- a/testsuite/python-colorconfig/ref/out-ocio23.txt +++ b/testsuite/python-colorconfig/ref/out-ocio23.txt @@ -18,7 +18,7 @@ resolve('foo'): foo resolve('linear'): Linear Rec.709 (sRGB) resolve('scene_linear'): ACEScg resolve('lin_srgb'): Linear Rec.709 (sRGB) -resolve('srgb'): sRGB - Display +resolve('srgb'): sRGB - Texture resolve('ACEScg'): ACEScg equivalent('lin_srgb', 'srgb'): False equivalent('scene_linear', 'srgb'): False diff --git a/testsuite/python-colorconfig/ref/out-ocio24.txt b/testsuite/python-colorconfig/ref/out-ocio24.txt index 0c49ae4440..1873e32a01 100644 --- a/testsuite/python-colorconfig/ref/out-ocio24.txt +++ b/testsuite/python-colorconfig/ref/out-ocio24.txt @@ -18,7 +18,7 @@ resolve('foo'): foo resolve('linear'): Linear Rec.709 (sRGB) resolve('scene_linear'): ACEScg resolve('lin_srgb'): Linear Rec.709 (sRGB) -resolve('srgb'): sRGB - Display +resolve('srgb'): sRGB Encoded Rec.709 (sRGB) resolve('ACEScg'): ACEScg equivalent('lin_srgb', 'srgb'): False equivalent('scene_linear', 'srgb'): False diff --git a/testsuite/python-colorconfig/ref/out-ocio25.txt b/testsuite/python-colorconfig/ref/out-ocio25.txt index 0840a3563a..0e39641050 100644 --- a/testsuite/python-colorconfig/ref/out-ocio25.txt +++ b/testsuite/python-colorconfig/ref/out-ocio25.txt @@ -18,7 +18,7 @@ resolve('foo'): foo resolve('linear'): Linear Rec.709 (sRGB) resolve('scene_linear'): ACEScg resolve('lin_srgb'): Linear Rec.709 (sRGB) -resolve('srgb'): sRGB - Display +resolve('srgb'): sRGB Encoded Rec.709 (sRGB) resolve('ACEScg'): ACEScg equivalent('lin_srgb', 'srgb'): False equivalent('scene_linear', 'srgb'): False diff --git a/testsuite/python-colorconfig/ref/out.txt b/testsuite/python-colorconfig/ref/out.txt index fa013c175b..e405a84e00 100644 --- a/testsuite/python-colorconfig/ref/out.txt +++ b/testsuite/python-colorconfig/ref/out.txt @@ -18,7 +18,7 @@ resolve('foo'): foo resolve('linear'): Linear Rec.709 (sRGB) resolve('scene_linear'): ACEScg resolve('lin_srgb'): Linear Rec.709 (sRGB) -resolve('srgb'): sRGB - Display +resolve('srgb'): sRGB - Texture resolve('ACEScg'): ACEScg equivalent('lin_srgb', 'srgb'): False equivalent('scene_linear', 'srgb'): False