To create a license plate, you can use a the following command line (ImageMagick):
Code:
convert -size 350x75 xc:none -fill white -stroke darkblue -strokewidth 3 -draw "roundrectangle 0,0 350,75 15,15" \
-compose over $1.png -geometry +15+15 +composite \
-fill darkblue -strokewidth 2 -pointsize 40 label:"$2" -geometry +25-0 -gravity east \
-trim +composite plate.png
I saved it in a file called
create_plate.sh.
Next, grant it execute permissions, with
chmod 755 create_plate.sh.
To call it from PHP:
PHP Code:
<?php
$sImage='rose';
$sPlateNumber='"PLATE 1234"';
$sCmd='./make_plate.sh '.$sImage.' '.$sPlateNumber;
`$sCmd`;
?>
<html>
<head>
</head>
<body>
<p>
<img src="plate.png" />
</p>
</body>
</html>
Notes:
$1.png (in the command line) is the name of an image you want to use for the plate. To create a small image from a larger image, you can use the following command:
Code:
convert rose: -thumbnail 50x50 rose.png
In this case, rose: is a built in image. Substitute your image file name for rose. 50x50 refers to the size of the new image, in pixels, and rose.png is the output file name.
$2 is the plate number.
To understand and adjust the other parameters, go to the ImageMagick site: htttp://www.imagemagick.org/Usage/