• Gamma Correction of OIIO


    apiitem{"oiio:ColorSpace" : string}
      The name of the color space of the color channels. Values incude:
      qkw{Linear}, qkw{sRGB}, qkw{GammaCorrected}, qkw{AdobeRGB},
      qkw{Rec709}, and qkw{KodakLog}.
      apiend
       
      apiitem{"oiio:Gamma" : float}
      If the color space is qkw{GammaCorrected}, this value is the gamma
      exponent.
      apiend
    The {cf ImageSpec::extra_attribs} field may store metadata that reveals
      the color space the image file in the qkw{oiio:ColorSpace}
      attribute, which may take on any of the following values:
       
      egin{description}
      item[halfspc m qkw{Linear}] indicates that the
      color pixel values are known to be linear.
      item[halfspc m qkw{GammaCorrected}] indicates
      that the color pixel values (but not alpha or $z$) have
      already been gamma corrected (raised to the power $1/gamma$), and
      that the gamma exponent may be found in the qkw{oiio:Gamma} metadata.
      item[halfspc m qkw{sRGB}] indicates that the
      color pixel values are in sRGB color space.
      item[halfspc m qkw{AdobeRGB}] indicates that the
      color pixel values are in Adobe RGB color space.
      item[halfspc m qkw{Rec709}] indicates that the
      color pixel values are in Rec709 color space.
      item[halfspc m qkw{KodakLog}] indicates that the
      color pixel values are in Kodak logarithmic color space.
      end{description}
       
      The ImageInput sets the qkw{oiio:ColorSpace} metadata in a
      purely advisory capacity --- the {cf read} will not convert pixel
      values among color spaces. Many image file formats only support
      nonlinear color spaces (for example, JPEG/JFIF dictates use of sRGB).
      So your application should intelligently deal with gamma-corrected and
      sRGB input, at the very least.
       
      The color space hints only describe color channels. You should assume that
      alpha or depth ($z$) channels (designated by the {cf alpha_channel} and
      {cf z_channel} fields, respectively) always represent linear values and
      should never be transformed by your application.

    spec.attribute("oiio::ColorSpace", "Linear");

    spec.attribute("oiio::ColorSpace", "GammaCorrected");
    spec.attribute("oiio::Gamma", (float)gamma);

    spec.attribute("oiio::ColorSpace", "sRGB");
    spec.attribute("oiio::ColorSpace", "Rec709");

    ----------------------------------------------------------------------------------------------------------

    Applies an inverse gamma correction to texture lookups. For example, a value of 2.2 will linearize a texture that comes in with a gamma of 2.2. This is done for 8 and 16 bit images.

    Arnold scans the contents of a texture (it does not rely on the extension) and anything that is not float is considered to have a gamma baked even if the image has a different color space embedded.

    Tx texture format

    You can convert your textures to linear space with the make tx tool. This way you can ensure that all of your textures are linear before rendering. For example:

    maketx --colorconvert sRGB linear C:solidanglemtoadeploy2014inimage.jpg
  • 相关阅读:
    QT QQuickView嵌入到QT MDI中
    地理入门-经纬度时区速成总结篇(转)
    Linux下系统时间函数、DST等相关问题总结(转)
    camera接口---MIPI CSI-2接口、DVP接口和FPD-Link III LVDS、GMSL等接口对比(转)
    基于spi FLASH的嵌入式文件系统 littlefs(转)
    PID 温控系统 解决方法(转)
    单相计量芯片RN8209D使用经验分享(转)
    【开源】EasyFlash 新年发布 V4.0 beta 版,完全重写(转)
    在uboot中加入cmd_run命令,运行环境变量(转)
    MPU6050开发 -- 数据分析(转)
  • 原文地址:https://www.cnblogs.com/len3d/p/4324746.html
Copyright © 2020-2023  润新知