title: Swap two colors using color matrix
body: <p>How can I swap two colors using a color matrix? For instance swapping red and blue is easy. The matrix would look like:</p>
  
  <pre><code>0 0 1 0 0
  0 1 0 0 0
  1 0 0 0 0
  0 0 0 1 0
  0 0 0 0 1
  </code></pre>
  
  <p>So how can I swap any two colors in general?  For example, there is Color1 with R1, G1, B1 and Color2 with R2, G2, B2.</p>
  
  <p>EDIT: By swap I mean Color1 will translate into color2 and color2 will translate into color1. Looks like I need a reflection transformation. How to calculate it?</p>
  
  <p>GIMP reference removed. Sorry for confusion.</p>