I'm new to ImageMagick and have a little problem.
I have several images of the same size (e.g. 24 images of 1280x960).
Each image contains only a ribbon of 40 pixels with useful data. The first from y=0-40, the second from y=40-80 and so on.
All pixels not on this ribbon are black.
What I want to do: Combining the several images to one image, which contains all ribbons.
My first try:
=> I loop over all images and use the combine console application to combine two images at a time:
=> composite -compose add img1.png img2.png result.png
This process takes a lot of time (compositing the complete image instead of just the ribbon) and I think one can do combination much faster.
It would be very nice if someone can help me with this.
Thanks in advance!
Best,
enkei666
Composite images
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Composite images
In command line, the fastest way would be to crop each image and append them.
convert image1[1280x40+0+0] image2[1280x40+0+40] image3[1280x40+0+80] ... -append combinedimage
alternately
convert image1 image2 ... image24 -fill none -opaque black -background black -flatten combinedimage
the latter makes all black into transparent and then flattens all images onto a black background, which should then be completely filled by the image strips
see
http://www.imagemagick.org/script/comma ... php#append
http://www.imagemagick.org/Usage/layers/#append
http://www.imagemagick.org/Usage/layers/#flatten
general reading and examples at:
http://www.imagemagick.org/Usage/
convert image1[1280x40+0+0] image2[1280x40+0+40] image3[1280x40+0+80] ... -append combinedimage
alternately
convert image1 image2 ... image24 -fill none -opaque black -background black -flatten combinedimage
the latter makes all black into transparent and then flattens all images onto a black background, which should then be completely filled by the image strips
see
http://www.imagemagick.org/script/comma ... php#append
http://www.imagemagick.org/Usage/layers/#append
http://www.imagemagick.org/Usage/layers/#flatten
general reading and examples at:
http://www.imagemagick.org/Usage/
Re: Composite images
Thank you very much!
Your first approach is extremly fast and works perfectly for my purpose
Best,
enkei666
Your first approach is extremly fast and works perfectly for my purpose

Best,
enkei666