Page 1 of 1
how merge some image on path with imagemagick?
Posted: 2014-12-01T07:30:40-07:00
by mostafanastary
Hi, in this topic :
viewtopic.php?f=1&t=26612
i create circle image with some image, but if we want to create another path like :
or
or any path we want, is there any solution?
Re: how merge some image on path with imagemagick?
Posted: 2014-12-01T11:01:35-07:00
by fmw42
The easiest solution is to pick the points on the path where you want each image to be located. See
http://www.imagemagick.org/Usage/layers/#convert
or
http://www.imagemagick.org/Usage/layers/#flatten
Re: how merge some image on path with imagemagick?
Posted: 2014-12-01T11:10:17-07:00
by mostafanastary
thank you fred,
it can be work for me,
best regards
Re: how merge some image on path with imagemagick?
Posted: 2014-12-02T15:38:45-07:00
by fmw42
Free hand paths would need to use a spline on a few selected (knot) points. That would be much more complicated but could be done by using my script, spline (see my signature link below).
However, you can use the same technique as the circle with any other mathematical equation for some curve using the math functions in -fx. For example, it would be easy to make a sinusoidal (wave) pattern using just sin() or cos(). See
http://www.imagemagick.org/script/fx.php
Re: how merge some image on path with imagemagick?
Posted: 2014-12-02T16:51:14-07:00
by mostafanastary
very very good script, i will try that, thank you fred.
Re: how merge some image on path with imagemagick?
Posted: 2014-12-02T17:29:07-07:00
by fmw42
The spline script by itself is not sufficient. It would have to be the basis of another script to take the spline data and pick equal interval points to use for each input image you provide. The spline script does not output the spline data. It just draws it in an image.
Also see Bezier splines in IM at
http://www.imagemagick.org/Usage/draw/
Re: how merge some image on path with imagemagick?
Posted: 2014-12-02T17:40:47-07:00
by fmw42
Re: how merge some image on path with imagemagick?
Posted: 2014-12-02T18:00:23-07:00
by fmw42
This may not be exactly what you want, but you can use montage to combine images (I just duplicated one, but you can provide a list to montage and script the first convert and pipe). Then use a warp such -wave to do the following:
input:
Code: Select all
convert question.gif -duplicate 19 miff:- |\
montage - -tile 20x -geometry +10+0 miff:- |\
convert - -wave 30x300 question_wave.gif
You can avoid the distortion by just using the original circle method with a sin or cos function for -fx to achieve something similar.
Re: how merge some image on path with imagemagick?
Posted: 2014-12-03T06:54:09-07:00
by mostafanastary
Wow, prefect.
thank you for share.