Page 1 of 1

45 degree frame joints

Posted: 2012-09-14T13:13:30-07:00
by Draoidh
Having worked through this user manual example, here's a slightly easier way to frame the image:

Image

fill, turn, fill, turn, ... :

Code: Select all

convert frame_template.gif \
-tile blackthin_top.gif -draw 'color 1,0 floodfill' -rotate 90 \
-tile blackthin_btm.gif -draw 'color 1,0 floodfill' -rotate 90 \
-tile blackthin_top.gif -draw 'color 1,0 floodfill' -rotate 90 \
-tile blackthin_btm.gif -draw 'color 1,0 floodfill' -rotate 90 \
-gravity center thumbnail.gif -composite frame_filled.gif
I say easier because it doesn't require you to calculate offsets. That means this part of the example code can be copied and works with images of any size. And if you use it in a script you don't need to script the offset calculations.

For this to work you will need to flip the bottom/right edge frame used in the example prior to using it:
Image

Re: 45 degree frame joints

Posted: 2012-09-16T23:34:38-07:00
by anthony
That is good, but the order of the edge elements are wrong.
The top edge image is used for the top and left edges, not the top and bottom edges.
It also need the bottom edge image to be flipped upside down to layer it correctly.

Get the order right and the edge image flipped, and will work very well for the thin black frame

However if you used rotates with the detailed gold frame, the highlight/shadow effects of internal detail will be wrong.
That is why transposes are used.

Hmm rotate the bottom edge...

Code: Select all

convert goldthin_btm.png -rotate 180 goldthin_btm2.png
now generate and fill the frame.

Code: Select all

convert thumbnail.gif -matte -bordercolor none \
            -compose Dst -frame 25x25+25 \
            -tile goldthin_top.png \
            -draw 'color 1,0 floodfill' -transpose -draw 'color 1,0 floodfill' \
            -transverse -tile goldthin_btm2.png \
            -draw 'color 1,0 floodfill' -transpose -draw 'color 1,0 floodfill' \
            -transverse    frame_gold.png
The only thing missing from this is some randomized offsets to remove some of the artifical look with such a detailed frame... very nice.

It will certainly make the framing examples less complex.

Here is the example I have now added to IM examples, which avoids intermediate images.

Code: Select all

  convert thumbnail.gif                -write mpr:image    +delete \
          goldthin_top.png             -write mpr:edge_top +delete \
          goldthin_btm.png -rotate 180 -write mpr:edge_btm +delete \
          \
          mpr:image -alpha set -bordercolor none \
          -compose Dst -frame 25x25+25  -compose over \
          \
          -transverse  -tile mpr:edge_btm \
          -draw 'color 1,0 floodfill' -transpose -draw 'color 1,0 floodfill' \
          -transverse  -tile mpr:edge_top \
          -draw 'color 1,0 floodfill' -transpose -draw 'color 1,0 floodfill' \
          \
          mpr:image -gravity center -composite    frame_gold.png
Image

Re: 45 degree frame joints

Posted: 2012-12-17T09:35:56-07:00
by creekpeanut
Thank you for the easy update