Combining 2 png in one with convert - macos

I am using convert from ImageMagick to combine 2 png in one using this script :
convert background.png logo.png -layers merge final_background.png
It is working but I would like to move the logo at 20 pixels from the top, is it possible ?
Thanks a lot
Thierry

I found how to do this :
convert background.png -page +0+130 stationLogo.png -page +0+440 -layers merge Default.png

Related

Merge an animated gif over a static png at a specific location using ImageMagick

I have managed to paste an animated gif over a static png and obtained an animated gif from
those sources with the following command.
convert canvas.png animation.gif test.gif
and it works, but the animation and the canvas share the upper left corner, which is not what I want.
By reading a little I discovered that I have to use either the -composite option or the command, but I have not found examples of the right syntax to use.
I tried this:
convert canvas.png animation.gif -geometry +780+275 -composite test01.gif
which gives a static image with just the first frame of animation.gif
I tried other syntax but just produces errors.
What is the right way to accommodate the animation?
Try the following in Imagemagick. It takes a special null: operator to separate the two images and -layer composite. Also you must use -page or -set page rather than -geometry when using -layers composite. The following is Unix syntax. For Windows, remove the \ before the parentheses.
convert canvas.png null: \( animation.gif -coalese -set page +780+275 \) -layers composite -layers optimize test01.gif

ImageMagick - convert png(s) to animated gif rather than having separate multiple overlapping images

Confuse as to what I'm doing wrong. I used the following command:
convert -loop 0 -delay 10 dog_cursor_24_1.png dog_cursor_24_2.png dog_cursor_24_3.png, dog_cursor_24_4.png, dog_cursor_24_5.png test.gif
Outputs a GIF image but upon viewing, the images are overlapping each other, which I do not want. Should look like a moving picture.
In Imagemagick, you do not use commas. So remove them. Put -loop 0 before the output gif and add +repage after reading the pngs to remove any virtual canvas.
convert -delay 10 dog_cursor_24_1.png dog_cursor_24_2.png dog_cursor_24_3.png dog_cursor_24_4.png dog_cursor_24_5.png +repage -loop 0 test.gif
If that does not work, then post your animation. It may need a different -dispose method.

Copyright/Watermark many images with different resolutions (with ImageMagick)

i am trying to solve the following problem:
I have one picture logo.png with a resolution of 1260x1580. I want to use this to copyright different JPG-Images, e.g. image1.jpg with a resolution of 1280x853. I want to have the logo e.g. at the bottom right and always with a height of e.g. 1/8 of the height of the JPG-Image.
Short: I have many images with different resolutions and the copyright should have always the same proportion (e.g. 1/8 of the total heigth) within that image.
I am using ImageMagick on command-line (on Windows 10), at the moment like this:
magick image1.jpg logo.png -resize x%[fx:u.h/8] -gravity SouthEast -geometry +15+15 -composite outfile.jpg
Unfortunately the resize-Option with x%[fx:u.h/8] doesn't work like expected, it also resizes the JPG-Image image1.jpg. I don't know, how i can manage it to resize only the logo.png and let the size of image1.jpg untouched. When i put ( logo.png -resize x%[fx:u.h/4] ) in brackets of course u.h then refers to logo.png, this is also wrong :-/
It would be great if you can assist me a little bit to find the right command for my purpose... Thanks for your replies and help!
PS: I hope that i didn't ignored some important source or help, but i can't find the solution by myself - sorry.
You have a stack of two images, the main input and the logo. You can have your "-resize" operation work on just the logo by adding a condition to the FX expression. Start your command with something like this...
magick image1.jpg logo.png -resize x%[fx:t==1?u[0].h/8:u[0].h] ...
The expression runs once for each image in the stack. The "t" substitutes for the position of the image in the stack, the first image is 0, the second is 1. So if "t" equals 1, it's the logo. Resize it to 1/8 the height of the first image indicated by "u[0].h/8". Otherwise resize it to "u[0].h", which is already the height of the first image, so it won't change that one.
In Imagemagick, try simply using parenthesis to limit the operation
magick image1.jpg ( logo.png -resize x%[fx:u.h/8] ) -gravity SouthEast -geometry +15+15 -composite outfile.jpg

Imagemagick: converting gif to pngs and pngs to gif produce different results

I am getting some problems trying to convert a gif file to pngs (change some colors in the pngs, but not yet) and then reconvert it into gif.
I convert the gif using: convert loading_32.gif loading.png. It produces 11 pngs files, what is pretty fine. But when I am trying to convert these pngs files into gif again using convert -delay 10 -loop 0 *.png loading2.gif , I get a different gif. Here the links to the gifs: original gif and generated gif
Hope someone can help!
This happens because *.png doesn't add the images in the original order. Try the following...
convert -delay 10 -loop 0 loading-{0..11}.png loading2.gif

slide Wipe effects with ImageMagick tool and ffmpeg

I have to do a four slide effects named 'Wipe Up', 'Wipe Down', 'Wipe Right', 'Wipe Left'. Like curtain of two images for each type. I think it can be possible with cropping of images with 'convert'
convert 01.jpg -crop 1920x5 output_%03d.jpg
where i can get sequence of images and compose at same time to the second image(What I don't know..) And then I can build video from this sequence of images with ffmpeg:
ffmpeg -i output_%03d.jpg out.mp4
Maybe someone can help me with compossing of images in the same time when I croping? Thanks for any suggestions!
PS: all images have fixed dimensions: 1920x1080
You could use ImageMagick's MIFF format (Multiple Image File Format) to send a stream of multiple, cropped images to another invocation of ImageMagick to put them together in a video sequence. So assuming you start with this:
and did this
convert input.png -crop 1920x10 miff:- | convert - -loop 0 out.gif
you would get this

Resources