Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Otherwise, just composite them back into a grid with the appropriate spacing you want onto whatever color background you want to show between the sections.
Freds script is a shell script and to run you need to:
1/ Upload to the server and find the path to the script.
2/ CHMOD the script to 777
3/ Using in php like:
<?php
// Setup the error array
$array = array();
exec("/home/user/public_html/folder/grid -s 200,100 -c red -t 10 -o 1 input.jpg grid.png 2>&1", $array);
//Display any errors
echo "<br><pre>".print_r($array)."<br>";
echo "</pre>";
?>
Using php you should be able to use getimagesize() and devide the width and height to get your variables then use that in Freds script. You may get a remainder and so it would be a good idea to crop or resize the image to a size that diveds well first.
I tried something like that: $command .= ' grid '.$this->image.' new_'.$this->image; but it does no effect. Maybe there's something wrong with IM version?
I tried install IM local on windows. And when i try to execute "grid" command i receive error. How i can run "grid" command on local installed IM ?
I do not know anything about symfony framework and I can not run shell scripts on my localhost either using XAMPP - no idea why.
Sorry I can not be of further help.
As the draw code works you could automate that, although the command line etc. could be quite long.
Get the image size - divide it by the amount of lines - draw the vertical lines from the to to the bottom - draw the horizontal lines from the side to side.
Grid is a unix bash shell script and requires PHP or IM compiled and accessible on a Unix or Max OSX platform. To use on Windows, you need to have Cygwin installed on Windows or something like it as there are numerous Unix function calls, such as grep, sed, awk, tr, bc, etc.
However, the basic concept behind the grid script is to use -draw for lines. So one just computes the spacing of the lines and then the end points and draws a sequence of horizontal and vertical lines. see tp://www.imagemagick.org/Usage/draw/#primitives
Last edited by fmw42 on 2009-11-19T18:25:48-07:00, edited 1 time in total.
Grid is a unix bash shell script and requires PHP or IM compiled and accessible on a Unix or Max OSX platform. To use on Windows, you need to have Cygwin installed on Windows or something like it as there are numerous Unix function calls, such as grep, sed, awk, tr, bc, etc.
Thanks for the explanation Fred; I did try Cygwin on my old PC but could not get it to work - the main problem I suppose was that I was not that interested in it !
I did have an old PC running Linux but when I started it up the other day and came back into the room there was a smell of burning electrical items and it was asking for a boot disc
I may convert my old windows XP machine over to Linux and have a play on it again.
should make an array of 12 separate images number 0-11.
I just wanted to say that that code worked great for me to split an image into 9 separate images (after changing 25% to 33.333%, of course), but only after leaving out the -repage option. convert complains that -repage requires an argument.