title: How do I replace any color that is not a specific color using PerlMagick?
body: <p>After many hair-pulling frustrations I've finally got one version of the PerlMagick module working with my ActivePerl 5.10.0 build 1005. Now I'm playing with it to do some very basic color substitution.</p>
  
  <p>I already can substitute one color ,say, black, with another, say, blue, using the following code:</p>
  
  <pre><code>#!perl
   use strict;
   use warnings;
   use Image::Magick;
  
    my $image = Image::Magick-&gt;new;
    $image-&gt;Read('color-test.bmp');
    $image-&gt;Opaque(fill =&gt; 'blue', color =&gt; 'black');
    $image-&gt;Write('result.bmp');
  </code></pre>
  
  <p>But I'm wondering if I can replace any color that is not black with the color blue. I hope and think there's some idiomatic syntax to achieve this, so I'm asking for a quick help :)  Any ideas? </p>
  
  <p>Thanks like always for any guidance/suggestions/comments :)</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>@rjh, thank YOU for the code and the information :) I tried 'em all with a little adpations and they all work like charm!  </p>
  
  <p>That older version cannot be run. My PerlMagick is 6.5.4, but with a little adapation, it also works like so:</p>
  
  <pre><code>  use strict;
    use warnings;
    use Image::Magick;
  
    my $image = Image::Magick-&gt;new;
    $image-&gt;Read('color-test.bmp');
       $image-&gt;Transparent(color=&gt;'black');
       $image-&gt;Colorize(fill=&gt;'blue');
       $image-&gt;Composite(image=&gt;$image);
       $image-&gt;Write('result.bmp');
  </code></pre>
  
  <p>Well, of course I like your second version. It's super. It's the very syntax that I was expecting, hehe :)</p>
  
  <p>And the first commandline version also works well although I was not expecting this version. </p>
  
  <p>Again, thanks!</p>