title: How can I fix PNG's gamma using ImageMagick?
body: <p>I'd like to fix a PNG's gamma value to <code>1/2.2</code>. For example, let's say there is a png image whose <code>gAMA</code> value is <code>1/4.4</code>. For some reasons, I have to fix the value to <code>1/2.2</code>. So I try <code>convert</code> command like below.</p>
  
  <pre><code># 0.5 is led by (1/4.4)/(1/2.2)
  # 0.45455 is led by 1/2.2
  $ convert orig.png -gamma 0.5 +gamma 0.45455 new.png
  </code></pre>
  
  <p>Then, I compare two images, <code>orig.png</code> and <code>new.png</code>, but they appear to be different.</p>
  
  <p>I guess the formula, <code>(1/4.4)/(1/2.2)</code>, is wrong. Does anyone know the correct way to do it?</p>
  
  <p>Thanks.</p>
  
  <p>EDITED:</p>
  
  <p>Sorry, but maybe I could not tell you what I really want to do. So, I added more information and sample images.</p>
  
  <p>First of all, I have the below image. This image's gAMA is about 0.227(1/4.4).
  <a href="https://i.stack.imgur.com/KJtw7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KJtw7.png" alt="This image&#39;s gAMA value is 0.227(1/4.4)"></a></p>
  
  <p>And then, I need this image. The image's gAMA is 0.4545(1/2.2) but the appearance is same as the above one.</p>
  
  <p><a href="https://i.stack.imgur.com/B0sKz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/B0sKz.png" alt="This image is what I want"></a></p>
  
  <p>So, I <strong>don't</strong> need this. This image's gAMA is also 0.4545(1/2.2), but the appearance is different from the first one.</p>
  
  <p><a href="https://i.stack.imgur.com/FDLcg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FDLcg.png" alt="This image&#39;s gAMA value is 0.4545(1/2.2)"></a></p>