title: Superimpose red/green images in R using image() or rasterImage()
body: <p>To highlight the difference between two identically sized matrices I would like to show the two superimposed in a semitransparent way using shades of red for the one matrix and shades of green for the other one (yielding yellow where they are identical) in R.</p>
  
  <p>To display just one matrix I have</p>
  
  <pre><code>library(grDevices)
  matr=replicate(10, rnorm(20,mean=0.5,sd=0.1))    
  colpalette=colorRampPalette(c("black", "red")) 
  image(matr^0.2,col = colpalette(1000),useRaster=T)
  </code></pre>
  
  <p>Does any one have any idea how I should adapt this to show two matrices <code>matr1</code> and <code>matr2</code> superimposed in red/green?</p>
  
  <p>Also, what would be the best way to have a bit of control over the brightness &amp; contrast of the resulting image? Are there better ways than the power transform I am using now?</p>
  
  <p>cheers,
  Tom</p>