fmw42 wrote:For one thing, your backslashes at the ends of the line MUST have spaces before them and no spaces after them.
Actually the shell simply deletes all occurrences of "\" followed by newline. The space is needed whenever the tokens on either side of it cannot be joined, but the space can appear either before the backslash, or at the beginning of the next line. But if you find the trailing blank more readable, I will stick with that.
fmw42 wrote:
You do not say where you want to add the rose image.
I want the rose to be placed immediately below the rubber stamp. Then I want that whole joined piece to be rotated 90 degrees and then put on the far right of the background logo, as a composite.
I'm struggling with just the simple first step. If I forget about the background and rotating, so that I'm only placing the rose below the stamp, I can't even get that much to work. My first attempt was to use montage, like this:
Code: Select all
montage \( -size 500x200 -background white -gravity center \
-fill red -font Arial -pointsize 128 label:"STAMP" \
-fill none -stroke red -strokewidth 10 \
-draw "translate 250,100 roundrectangle -220,-75 220,75 20,20" \) \
\( -size 500x200 xc: +noise random -channel g -separate +channel \
-blur 0x2 -threshold 55% -transparent black \) \
-compose over -composite -fuzz 10% -transparent white \
rose: show:
That error'd as "montage: unrecognized option `+noise' @ error/montage.c/MontageImageCommand/1268." So then I went back to
convert, and tried to use append, like this:
Code: Select all
convert \( -size 500x200 -background white -gravity center \
-fill red -font Arial -pointsize 128 label:"STAMP" \
-fill none -stroke red -strokewidth 10 \
-draw "translate 250,100 roundrectangle -220,-75 220,75 20,20" \) \
\( -size 500x200 xc: +noise random -channel g -separate +channel \
-blur 0x2 -threshold 55% -transparent black \) \
-compose over -composite -fuzz 10% -transparent white \
-append rose: show:
The rose was neglected in that rendering.
*edit* I see my problem with append.. the "-append" must come
after the rose:.
In your example, you use "-composite" to place the rose with hard-coded positioning. I want to avoid that, because conceptually I want to glue two things together, and then treat that whole object as one thing. I hope that I can escape some of the coordinate+offset chaos by defining building blocks that can grow and become part of other building blocks.
I think the best code avoids literal sizes and literal positions as much as possible, and uses relative data as much as possible. Numbers get under my skin.
Anyway, this is closer to the complex thing I'm after:
Code: Select all
convert \( \( -size 500x200 -background white -gravity center \
-fill red -font Arial -pointsize 128 label:"STAMP" \
-fill none -stroke red -strokewidth 10 \
-draw "translate 250,100 roundrectangle -220,-75 220,75 20,20" \) \
\( -size 500x200 xc: +noise random -channel g -separate +channel \
-blur 0x2 -threshold 55% -transparent black \) \
-compose over -composite -fuzz 10% -transparent white \) \
magick:rose -append -rotate 90 -gravity east magick:logo +swap -composite show:
My next problem is making the background of the rose transparent.
fmw42 wrote:
Note you can specify the rose: and logo: images with a colon after them as stated here rather than prefacing with magick:rose and magick:logo
The documentation said "logo:" exists for "backwards compatibility", so I took that to mean that "magick:logo" might obsolete the other style. But I don't mind using the shorter form.