zoukankan      html  css  js  c++  java
  • 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
  • 相关阅读:
    3747 [POI2015]Kinoman
    1303 [CQOI2009]中位数图
    3769 [spoj 8549] BST again
    1015 [JSOI2008]星球大战starwar
    1193 [HNOI2006]马步距离
    合并Git仓库不相关历史版本解决方案
    vue-cli项目实现动态锚点定位
    jQuery加css3实现菜单栏组件(可无限添加子列表)
    JavaScript文件转成base64编码
    Ajax获取服务器响应头部信息
  • 原文地址:https://www.cnblogs.com/len3d/p/4324746.html
Copyright © 2011-2022 走看看