title: Cs50 sepia problem with converting image from normal to sepia
body: <p>I'm working on a cs50 program called filter(less comfortable, week 4), and it has to transfer images from normal to sepia. It's working fine unless it has to transfer the color white. When trying to transfer the color white, it just converts it to blue and green. Like so:</p>
  <p><strong>ORIGINAL</strong></p>
  <p><a href="https://i.stack.imgur.com/sxWXM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sxWXM.png" alt="ORIGINAL" /></a></p>
  <p><strong>SEPIA</strong></p>
  <p><a href="https://i.stack.imgur.com/zsb1Y.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zsb1Y.png" alt="enter image description here" /></a></p>
  <p>As you can see, it converted everything fine, except for the white or close-to-white colors.
  Here's my code(Sepia part only):</p>
  <pre class="lang-c prettyprint-override"><code>
  void sepia(int height, int width, RGBTRIPLE image[height][width])
  {
      for(int j = 0; j &lt; width; j++)
      {
         for (int i = 0; i &lt; height; i++)
         {
             int sepiared =  image[i][j].rgbtRed *.393  +   image[i][j].rgbtGreen *.769 +  image[i][j].rgbtBlue *.189;
             int sepiagreen =  image[i][j].rgbtRed *.349  +  image[i][j].rgbtGreen *.686 +  image[i][j].rgbtBlue *.168;
              int sepiablue =  image[i][j].rgbtRed *.272  +   image[i][j].rgbtGreen *.534 +  image[i][j].rgbtBlue *.131;
             image[i][j].rgbtRed = sepiared;
             image[i][j].rgbtGreen = sepiagreen;
             image[i][j].rgbtBlue = sepiablue;
         }
      }
  
      return;
  }
  </code></pre>
  <p>Please help me understand why this happens. Clang prints no error messages.</p>
  <p>Yours truly,
  Lost in code:)</p>