title: How to manipulate an image at pixel level in C?
body: <p>How do I read an image in C so that I can have direct control over its pixels (like we do in MATLAB)?</p>
  
  <p>I tried the old way:</p>
  
  <pre><code>FILE *fp;
  fp = fopen("C:\\a.tif","r");
  </code></pre>
  
  <p>that just gives me the <code>ascii</code> form of the image file (I think).</p>
  
  <p><strong>How can I get pixel level control over the image and do some basic operations like say, inverting the image?</strong></p>