Hello to all
I need to use a small logo, such as 50px x 30px at a given point in an image, the files in question are:
photo.png
logo.png
command that should be used for example to insert it in the lower right detaching a little from the edges?es?
Insert logo in the photo
- GeeMack
- Posts: 718
- Joined: 2015-12-01T22:09:46-07:00
- Authentication code: 1151
- Location: Central Illinois, USA
Re: Insert logo in the photo
First, please always provide your IM version and platform. Refer to this topic — Please Read This FIRST Before Posting — at the top of the forum category for instructions on how to post a question to get the most helpful replies.
Using ImageMagic v6, the simplest approach to overlaying one image on another is to do a "-composite" operation something like this...
Code: Select all
convert photo.png logo.png -gravity southeast -geometry +10+10 -composite output.png
Re: Insert logo in the photo
Hello, thank you so much response. It 'the first time you use this library, usually I used gd but not having installed php on my PC (using linux) I needed something to terminal to automate the insertion of a logo on the images.
I'm finding out slowly imagemagick and I must say it is fantastic.
I tried your suggestion and it works great. One thing, it would be possible to apply the inclusion of "logo.png" in all the photos in this directory?
There are many, like 100, it would be possible to add it at all? thank you so much.
I'm finding out slowly imagemagick and I must say it is fantastic.
I tried your suggestion and it works great. One thing, it would be possible to apply the inclusion of "logo.png" in all the photos in this directory?
There are many, like 100, it would be possible to add it at all? thank you so much.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Insert logo in the photo
What is your IM version and platform. Please alway provide that since syntax and approach may differ.
Generally you can do that using Mogrify. See
http://www.imagemagick.org/Usage/basics/#mogrify
http://www.imagemagick.org/Usage/basics ... fy_compose
Are all your images the same file format such as PNG in the directory? Is the watermark image a PNG and is it in the same directory. If the watermark image is not a PNG or all your other images are not png, then you can keep the watermark in the same directory. If they are the same, then you need to move the watermark image to a new location.
I would suggest you create a new directory to hold your results from mogrify. Say your images are in folder1 and you have an empty directory folder2. Then
If you want all image types in folder1, then do
This will make png output images. If you want a different output, then change -format, such as -format jpg. If your watermark image is not png, then change that suffix.
If you are using IM 7, then put "magick" before mogrify.
For novices, see
viewtopic.php?f=1&t=9620
http://www.imagemagick.org/script/comma ... essing.php
http://www.imagemagick.org/Usage/reference.html
http://www.imagemagick.org/Usage/
Generally you can do that using Mogrify. See
http://www.imagemagick.org/Usage/basics/#mogrify
http://www.imagemagick.org/Usage/basics ... fy_compose
Are all your images the same file format such as PNG in the directory? Is the watermark image a PNG and is it in the same directory. If the watermark image is not a PNG or all your other images are not png, then you can keep the watermark in the same directory. If they are the same, then you need to move the watermark image to a new location.
I would suggest you create a new directory to hold your results from mogrify. Say your images are in folder1 and you have an empty directory folder2. Then
Code: Select all
cd path2/folder1
mogrify -path path2/folder2 -format png -draw 'image over 0,0 0,0 "path2/watermark.png"' *.png
Code: Select all
cd path2/folder1
mogrify -path path2/folder2 -format png -draw 'image over 0,0 0,0 "path2/watermark.png"' *
If you are using IM 7, then put "magick" before mogrify.
For novices, see
viewtopic.php?f=1&t=9620
http://www.imagemagick.org/script/comma ... essing.php
http://www.imagemagick.org/Usage/reference.html
http://www.imagemagick.org/Usage/