0

I have a group of image with a specifc width and height.Now I want all the images with a round border. So can someone tell me how to make batch render round border of all the images in imagemagick, I am using php. Any help or suggestions will be highly appreciable.

NewUser
  • 12,713
  • 39
  • 142
  • 236

1 Answers1

0

You just have to create a foreach that covers all files that need to be converted using a line like:

$imageWidth = 800;
$imageHeight = 600;
$borderSize = 20;
foreach($files as $file)
{
  exec('convert -size '.$imageWidth.'x'.$imageHeight.' xc:none -draw "roundRectangle 0,0 '.$imageWidth.','.$imageHeight.' '.$borderSize.','.$borderSize.'" -fill white '.$file.' -compose SrcIn -composite +compress out-'.file);
}

Probably you'll want to check the image size file by file.

samura
  • 4,375
  • 1
  • 19
  • 26