On Fri, 21 Aug 2009 16:06:38 +1000 (EST)
"damien dunlop" <[email protected]> wrote:
| # One can append a slice of one image to a slice of
| # another as follows - for n such cases.
|
| convert A1.gif -crop w1xh1+0+h2 \
| \( B1.gif -crop w1xh3+0+0 \) \
| -append C1.gif
|
| convert A2.gif -crop w1xh1+0+h2 \
| \( B2.gif -crop w1xh3+0+0 \) \
| -append C2.gif
| ...............................
|
| convert An.gif -crop w1xh1+0+h2 \
| \( Bn.gif -crop w1xh3+0+0 \) \
| -append Cn.gif
|
| # A. How can this be done for the same sets of images
| # by invoking convert just once?
|
| # Thinking I had a reasonable idea of how ImageMagick
| # worked, I have tried various combinations using both
| # +delete and -write to no avail.
|
| # B. What is the ImageMagick process in achieving A.?
|
| Damien
|
Hmmm, First you better add a few +repages you will have
virtual canvas problems!
Solution #1
Well you can just create a masive command line like this...
convert A1.gif -crop w1xh1+0+h2 +repage \
\( B1.gif -crop w1xh3+0+0 +repage \) \
-append -write C1.gif +delete \
A2.gif -crop w1xh1+0+h2 +repage \
\( B2.gif -crop w1xh3+0+0 +repage \) \
-append -write C2.gif +delete \
....
An.gif -crop w1xh1+0+h2 +repage \
\( Bn.gif -crop w1xh3+0+0 +repage \) \
-append -write Cn.gif +delete \
null:
the final null: writes nothing!
Solution #2
You can also do this which is tricky but should work...
Crop the parts of A then append side-by-side
repeat with B, then vertically append the two images
and tile crop them into separate images, and save!
convert \( A*.gif -crop w1xh1+0+h2 +repage +append \) \
\( B*.gif -crop w1xh3+0+0 +repage +append \) \
-append -crop w1x0 +repage \
-scene 1 +adjoin C%d.gif
Solution #3
Add space and layer compose the second images into the first!
Layer compose merges two sequences of images separated by a null: image
But other than that (and its understanding of -page) it is
just a multiple image -composite
With h4 = h1 + h3 so w1xh4 is the final C image size.
convert A*.gif -crop w1xh1+0+h2 +repage \
-background none -extent w1xh4 \
null: \( B*.gif -crop w1xh3+0+0 +repage \) \
-geometry +0+h1 -layers composite \
-scene 1 +adjoin C%d.gif
This may be faster!
The last two are also documented in side-by-side animation appending
http://www.imagemagick.org/Usage/anim_mods/#append
Though arranged so no knowledge of image sizes was needed.
Anthony Thyssen ( System Programmer ) <[email protected]>
-----------------------------------------------------------------------------
`` Intriging! I wish I had more time to discuss this matter ''
`` Why don't you have more time? ''
`` Because I must detonate in 75 seconds! '' -- thermostellar bomb #20
-- Classic SciFi Movie ``DarkStar'', 1974
-----------------------------------------------------------------------------
Anthony's Home is his Castle http://www.cit.gu.edu.au/~anthony/
_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users