title: How to pixelate part of image using ImageMagick?
body: <p>I'm trying to figure out a way to pixelate only part of an image but no success so far.</p>
  
  <p>Currently I'm following the following this tutorial: <a href="http://www.mutinydesign.co.uk/free-scripts/live-photo-blurring-script/" rel="nofollow">http://www.mutinydesign.co.uk/free-scripts/live-photo-blurring-script/</a></p>
  
  <p>Using the jQuery plugin "imgAreaSelect" so that users can select part of the picture from the UI.  Then the click 'pixelate'.  This then makes an ajax call to the pixelate function written in php for imagemagick.  The pixelate function looks like this:</p>
  
  <pre><code>&lt;?php
  $x1 = $_GET['x1'];
  $y1 = $_GET['y1'];
  $x2 = $_GET['x2'];
  $y2 = $_GET['y2'];
  $inputImage = $_GET['inputImage'];
  $outputImage = 'output_'.$_GET['inputImage'];
  
  exec( "convert {$inputImage} \( +clone -scale 20%  -scale 500% \) \
        \( +clone -gamma 0 -fill white \
        -draw 'rectangle {$x1},{$y1} {$x2},{$y2}' -blur  10x4 \) \
        -composite  {$outputImage}" );
  
  echo $outputImage;
  ?&gt;
  </code></pre>
  
  <p>This does work but it pixelates the whole image and not just the part selected.  Any ideas or suggestions appreciated.  Has anyone been able to accomplish something similar? </p>