Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
I'm new to ImageMagick and could use some help. I'm running IM through PHP and have to generate two lines of outlined text. The only way that I could get it to work and look the way I wanted was to do two convert commands to generate two versions of the same text... one with a white border, then one with the same size transparent border... so that I could overlay one over the other and get a white border around readable text.
Since I'm generating two lines of text, I needed 4 "convert" commands to create the two lines... and I just know this could be simplified in order to speed things up.
Thanks for the links. I've been checking these out for a little while (before today)... and just haven't been able to get them to work for me. Every time I try to combine the two commands for creating the top/bottom line of text, it fails and I get nothing.
If anyone can provide an example that is structured similarly to the way my code is working, that would be a HUGE help. I think I'm not ordering the commands correctly... and the need to concatenate all of the PHP variables together into the $command string being assembled for the $convert is making my eyes cross.
I'm still stuck on this... anyone out there able to give me a push? I'm not sure which of the items in the "$command" lines could be consolidated... where I need to "clone"... etc.
Why do you have these in you code as far as I know -rotate 0 will have no effect and -distort Arc "0 0" will either throw an error or have no effect either.
An example of the output you want would be helpful and as fmw42 says supply some simple code. It always makes things easier if you can get the code working with direct inputs before you start using variables and values submitted from another page.
//Create Top Line with white stroke
$command = "convert -background transparent -gravity center -stroke '#fffffe' -strokewidth 13 -fill '#120255' -font /Users/bcbounders/Sites/babyloveshirts/fonts/Desyrel.ttf -size 1270x300 -pointsize 140 label:'Top Line' -bordercolor none -border 2 -rotate 0 -distort Arc '45 0' output_topline.png";
exec($command);
//Create top line with transparent stroke to overlay on previous image
$command = "convert -background transparent -gravity center -stroke transparent -strokewidth 13 -fill '#120255' -font /Users/bcbounders/Sites/babyloveshirts/fonts/Desyrel.ttf -size 1270x300 -pointsize 140 label:'Top Line' -bordercolor none -border 2 -rotate 0 -distort Arc '45 0' output_topline2.png";
exec($command);
The output from these two lines looks like this: First Pass Top Line
Second Pass Top Line
Further code (GD Library) takes the two and merges them together later in the process, overlaying Line 2 on top of Line 1 so they look like this... the white stroke of the first showing through behind the transparent stroke on the second file: Finished Text
Does that make sense? Can those two lines be combined as one to speed processing?
Using Arial as I do not have your font. You can replace with your font. Use parenthesis for each command with no output, then compose the second over the first.
SWEET! Thanks... I'll have to give that a try... then start peppering in the PHP variables to get it to work with my front-end. I want to do it right now... but I'm running out the door for dinner, so I'm gonna have to wait. BUMMER! But I'll report back.
You rock! That did the trick! I tested it first without the PHP variables being inserted and it worked, no problem. Now I've got my variables being inserted again... and all is right with the world.