I’m trying to understand how to pixelize only part of the image, but so far I haven’t achieved anything.
I am currently following the guide below: http://www.mutinydesign.co.uk/free-scripts/live-photo-blurring-script/
Using the jQuery plugin "imgAreaSelect" so that users can select part of the image from the user interface. Then click "pixelate". Then it makes an ajax call to the pixelate function written in php for imagemagick. The pixelate function is as follows:
<?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; ?>
This works, but pixels the entire image, not just the selected part. Any ideas or suggestions appreciated. Has anyone been able to achieve something like this?
source share