Here is an even easier way to extend the edges of the Northwest corner:
# crop and make transparent
convert fancy_add.jpg[60x88+2+2] -fuzz 20% -transparent
"rgb(255,255,255)" +repage fancy_add2.gif
http://www.fmwconcepts.com/misc_tests/Framing/fancy_add2.gif
# flop to get Northwest corner
convert fancy_add2.gif -flop fancy_add4.gif
# extend Northwest corner to 100x150 (quarter size)
convert -size 100x150 xc:"#ffffffff" -channel RGBA fancy_add4.gif
-fx "v" fancy_add5.gif
Then do something similar to the last step below to montage
rearranged quadrants.
______________________________________
I have taken your fancy add.jpg cropped it to get rid of excess
surrounding and such, then flipped it to get the southwest corner,
made the white into transparent, extended the edges to fill out one
quarter of the frame, then rearranged the quadrant to get the others
and merged them so that it fills 200x300.
Here are my steps:
# crop and make transparent
convert fancy_add.jpg[60x88+2+2] -fuzz 20% -transparent
"rgb(255,255,255)" +repage fancy_add2.gif
http://www.fmwconcepts.com/misc_tests/Framing/fancy_add2.gif
# test montage of minimum size frame
montage \( fancy_add2.gif -flop \) \
\( fancy_add2.gif \) \
\( fancy_add2.gif -flip -flop \) \
\( fancy_add2.gif -flip \) \
-tile x2 -geometry 60x88+0+0 -background none fancy_add_frame1.gif
http://www.fmwconcepts.com/misc_tests/Framing/fancy_add_frame1.gif
# flip to get southwest corner and extend sides to fill out one
quarter of desired size frame
convert \( fancy_add2.gif -flip \) \
\( +clone -crop 1x88+1+0 +repage -scale 40x88! \) +swap
+append +repage \
\( +clone -crop 100x1+0+1 +repage -scale 100x62! \) +swap
-append +repage \
fancy_add3.gif
http://www.fmwconcepts.com/misc_tests/Framing/fancy_add3.gif
# flip, flop and rotate 180 (flip and flop) and montage together with no space
montage \( fancy_add3.gif -flip -flop \) \( fancy_add3.gif -flip \) \
\( fancy_add3.gif -flop \) fancy_add3.gif \
-geometry +0+0 -tile x2 -background none fancy_add_frame2.gif
http://www.fmwconcepts.com/misc_tests/Framing/fancy_add_frame2.gif
With a little work, you can parameterize the sizes in step 3 above so
that you can make the frame any size you want.
With a little more work you can probably get this down to one step
for the last two above (or perhaps even for steps 1, 3 and 4).
All I have is a non-transparent corner piece of a real picture frame and I
want to use it wrap around an image.
Frame image that I want to wrap:
http://beta.posters2prints.com/scripts/fancy_add.jpg
Image that I want to wrap:
http://beta.posters2prints.com/scripts/thumbnail.jpg
_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users