title: how to implement color temperature &tint correction algorithm same as Photoshop using python
body: <p>I'm looking for an algorithm for color temperature and color tint correction slider just like in Photoshop. I read <a href="https://en.wikipedia.org/wiki/Color_temperature" rel="nofollow noreferrer">wiki page about color temperature .</a> and understood how to approximately calculate correlated color temperature(CCT) in XYZ-color space.</p>
  
  <p>And I found <a href="http://www.tannerhelland.com/4435/convert-temperature-rgb-algorithm-code/" rel="nofollow noreferrer">an alogirhtm</a> for directly adjust color-temperature of RGB image, using approximation(of the color of specific color temperature) and alpha-blending(with original image and color temperature).
  I also know how to <a href="https://stackoverflow.com/questions/11884544/setting-color-temperature-for-a-given-image-like-in-photoshop">convert color temperature from the pre-calculated table</a> (I also referenced color temperature correcting algorithm in Imagemagick.)</p>
  
  <p>and the color temperature histogram I got from various post is below.</p>
  
  <p><a href="https://i.stack.imgur.com/Hd6AS.png" rel="nofollow noreferrer"><strong>image1:</strong> color temperature from web</a></p>
  
  <p>But in color temperature correction from Photoshop is quite different from ones above.</p>
  
  <p><a href="https://i.stack.imgur.com/QOdaQ.png" rel="nofollow noreferrer"><strong>image2:</strong> color temperature&amp;tint slide from photoshop</a></p>
  
  <p>using color-temperature correction from the web, I never could get the same effect of temperature correction on photoshop. because in other algorithms, when the temperature goes down, <strong>orange(or red) color</strong> is increased on the image, but in photoshop, <strong>the yellow color</strong> is increased. And I can't get yellowish image from other algorithms.</p>
  
  <p>I'm really curious why this happens and hopefully wanna know how to programmatically get the same effect of color temperature &amp; tint correction slider from photoshop.</p>
  
  <p>Can anybody give me any clue?</p>