title: ImageMagick: Decreasing RGB values of all pixels in an image
body: <p>Specifically, with a given image I'm trying to decrease the RGB values for each pixel by 100.</p>
  
  <p>For example, if a pixel has R: 232, G: 40, B: 120 then I want the new RGB values to be R: 132, G: 0, B: 20.</p>
  
  <p>I have tried this solution that I found on the ImageMagick forums:</p>
  
  <pre><code>convert input.jpg -channel R -evaluate subtract 25700 \
  -channel G -evaluate subtract 25700 \
  -channel B -evaluate subtract 25700 output.jpg
  </code></pre>
  
  <p>Edit: the reason I use 25700 is because apparently you need to multiply the rgb value by 257. 100 * 257 = 25700.</p>
  
  <p>While it appears to work at first (clearly darkening the image), it seems that certain pixels will not change and for what I'm doing it's vital that they do (I'm running a trim on the resulting image, trying to trim away the border with pixel values of 0). </p>
  
  <p>An common problem is that I'll end up with a pixel that has a RGB values of 3, 0, 0, but I'll want that pixel to have values of 0 for RGB and increase the constant I subtract by - but it doesn't seem to work.</p>
  
  <p>Any ideas? Thanks!</p>