mpr

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?".
Post Reply
excel
Posts: 18
Joined: 2015-12-19T13:16:12-07:00
Authentication code: 1151

mpr

Post by excel »

Why not work with mpr ?


Working

convert delimeter.png -write mpr:delimeter +delete -respect-parentheses \
\( background.png mpr:delimeter -compose Dst_Out -gravity south -alpha Set -composite +write section.png \) \
\( convert section.png -alpha set \
\( +clone -background '#000000' -shadow 100x0+0+5 \) \
+swap -background none -mosaic +write result.png \)



Not working

convert delimeter.png -write mpr:delimeter +delete -respect-parentheses \
\( background.png mpr:delimeter -compose Dst_Out -gravity south -alpha Set -composite +write mpr:section \) \
\( convert mpr:section -alpha set \
\( +clone -background '#000000' -shadow 100x0+0+5 \) \
+swap -background none -mosaic +write result.png \)



Problem with mpr:section.
Help Please.
User avatar
GeeMack
Posts: 718
Joined: 2015-12-01T22:09:46-07:00
Authentication code: 1151
Location: Central Illinois, USA

Re: mpr

Post by GeeMack »

Looks like you're trying to access the "mpr:section" from a new "convert" command. I'm not on a *nix to test it now, but maybe try a "-delete 0--1" after the first "mpr:section" and get rid of the second "convert" command. It might squawk at the end because there's no file name being written, so you might have to put /dev/null after the whole thing (or move your last "result.png" outside the parenthesis and get rid of the last "-write"). Something like that.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: mpr

Post by fmw42 »

You do not need mpr at all and if you did want to use it, you cannot have a second convert in your parentheses or anywhere else in the command line. Try

Code: Select all

convert background.png delimeter.png -gravity south -compose Dst_Out -composite \
\( +clone -background '#000000' -shadow 100x0+0+5 \) \
+swap -background none -layers merge +repage result.png
see http://www.imagemagick.org/Usage/blur/#shadow
excel
Posts: 18
Joined: 2015-12-19T13:16:12-07:00
Authentication code: 1151

Re: mpr

Post by excel »

Images:

1. background.png (without opacity)
Image


2. delimeter.png (with opacity)
Image


Need such result.png (with opacity)
Image
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: mpr

Post by fmw42 »

try this

Code: Select all

convert background.png delimeter.png -compose Dst_Out -gravity south -composite -alpha on \
\( -clone 0 -background '#000000' -shadow 100x0+0+5 \) \
+swap -background none -compose over -layers merge +repage result.png
You have to reset the compose method to over before the -layers merge; otherwise -layers merge tries to use Dst_Out.
excel
Posts: 18
Joined: 2015-12-19T13:16:12-07:00
Authentication code: 1151

Re: mpr

Post by excel »

fmw42 wrote:try this

Code: Select all

convert background.png delimeter.png -compose Dst_Out -gravity south -composite -alpha on \
\( -clone 0 -background '#000000' -shadow 100x0+0+5 \) \
+swap -background none -compose over -layers merge +repage result.png
You have to reset the compose method to over before the -layers merge; otherwise -layers merge tries to use Dst_Out.

Thanks! It works!
Post Reply