excel wrote:How in one exec command to compose a frame and to get result.png?
It might be easier to understand what your code is doing if you bring the "image.png" in first. Then after it's in the working stack, build your dotted line rectangle inside the parentheses. At that point you have two images in the stack, the orange rectangle is the first image and the dotted rectangle is the second. Then after you set the gravity to center, "-composite" will simply lay your dotted lines down onto your orange rectangle and output "result.png".
Maybe try something like this...
Code: Select all
convert image.png \
\( -size 200x50 xc:none -stroke '#ffffb7' -strokewidth 1 -fill none \
-draw "stroke-dasharray 4 4 path 'M 8,8 192,8 192,42 8,42 8,8' " \) \
-gravity center -composite -alpha Set -depth 8 result.png
You don't really need to write anything to a memory register "mpr:dotted_frame" unless you'll be doing something else with that by adding more to your command. And you don't need the "+write" before your output file name. IM already assumes the last image file name in the command will be the output file.
You can even make the orange rectangle then draw the dotted lines directly on it without any compositing if a short command like this would serve your purpose...
Code: Select all
convert -size 200x50 xc:'#e84700' -stroke '#ffffb7' -strokewidth 1 -fill none \
-draw "stroke-dasharray 4 4 path 'M 8,8 192,8 192,42 8,42 8,8'" -depth 8 result2.png