title: How do I recolor an image? (see images)
body: <p>How do I achieve this kind of color replacement programmatically?
  <img src="https://i.stack.imgur.com/yo9bg.png" alt="replacing black with blue"></p>
  
  <hr>
  
  <p>So this is the function I have used to replace a pixel:</p>
  
  <pre><code>Color.FromArgb(
      oldColorInThisPixel.R + (byte)((1 - oldColorInThisPixel.R / 255.0) * colorToReplaceWith.R),
      oldColorInThisPixel.G + (byte)((1 - oldColorInThisPixel.G / 255.0) * colorToReplaceWith.G),
      oldColorInThisPixel.B + (byte)((1 - oldColorInThisPixel.B / 255.0) * colorToReplaceWith.B)
      )
  </code></pre>
  
  <p>Thank you, CodeInChaos!</p>