Position one image on another

(David) #1

Hello everyone,

I just want to position one image on another, centering it, how can I do?

With imagemagick just do:

composite -compose Over -gravity center

How to do with gmic?

Here are the two images that I want to superpose:

gmic photo.jpg --mirror[-1] x -imagegrid_triangular[0] 6,10,3,0.5 -resize[0] 120%,120%

Thank you !

0 Likes

(G'MIC staff) #2

Not sure how you want to superpose them. Adding something as j[0] [1],10%,10% rm[-1] at the end of your command line would be enough maybe ?

0 Likes

#3

image

is equivalent to

gmic smile.gif split_opacity rose.jpg image[2] [0],{(70-48)/2},0,0,0,1,[1],255 keep[2]

Remarks

  • split_opacity extracts the alpha channel from smile.gif into a separate image.
  • See: http://gmic.eu/reference.shtml#image
  • {(70-48)/2} centres smile.gif over rose.jpg over the x-axis.
  • Values 0 to 2 in [] selects the appropriate images to act upon.
0 Likes

#4

70 and 48 could be replaced with w#0 and w#1.

0 Likes

#5

Didn’t want to complicate matters with more syntax.

0 Likes

(David) #6

Thank you all!

0 Likes

#7

Cheers. Just curious: What made you decide to use G’MIC in the place of ImageMagick? If you need any help with IM, just ask @snibgo. He is on the IM forums too. Both are useful but nowadays I use G’MIC most of the time.

0 Likes

(David) #8

gmic is much faster to run some nice 3D animations (the calculations are done natively) unlike Imagemagick or you had to write a lot of code. A good example is the 3d cube, impossible to create directly with Imagemagick, you must write yourself all the calculations of position of the faces (or use script ex: http://www.fmwconcepts.com/imagemagick/3Dbox/index.php). It’s a lot longer to run …
I want to avoid using Imagemagick as much as possible when I’m using gmic to improve the speed of the final render.

1 Like