Imagemagick convert from PHP, to draw 2 borders on image -


i take simple image file (500px width example) folder, in php , exec('/usr/bin/convert -etc.') image , achieve this: http://imm.io/media/3o/3o7j.jpg . basically, want draw 2 colored borders/rectangles around image @ specific positions. can compose such command, or possible ?

thank you.

this may easier using gd extension in php. specifically, imagesetstyle() function set line dashes, , imageline() draw lines.

this example loads image , draws dashed line on it. should able adapt needs.

<?php $im  = imagecreatefromjpeg('/your/file.jpg'); $w   = imagecolorallocate($im, 255, 255, 255); $red = imagecolorallocate($im, 255, 0, 0);  /* draw dashed line, 5 red pixels, 5 white pixels */ $style = array($red, $red, $red, $red, $red, $w, $w, $w, $w, $w); imagesetstyle($im, $style); imageline($im, 0, 0, 100, 100, img_color_styled);  imagejpeg($im, '/path/to/save.jpg'); imagedestroy($im); ?> 

Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -