Image with watermark without transparency

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
djconcept
Posts: 3
Joined: 2017-01-08T14:41:46-07:00
Authentication code: 1151

Image with watermark without transparency

Post by djconcept »

Hello everyone,
I am new to the forum, but I have been consulting the various topics for a few days / weeks now.
I found a lot of solution and answers to my many questions with the help of documentation and forum.
Thank you for this work! Really great!
But here are 4 evenings that I try to do a simple thing.
I have a picture "picture_1.jpg" and I have a watermark "watermark.png" and I want this result there:
Image
Image
Image

But I can not ... I always have the same result ...
Image
I used a whole variant of solution, but without success:
Last example:

Code: Select all

composite -dissolve 100 -gravity southeast /home/pi/drumminhands_photobooth-master/images/watermark.png " + generated_filepath + now + "*.jpg -alpha set " + generated_filepath + now + "xxx*.jpg"
I really want my watermark to be "opaque".

Thank you in advance for your help.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Image with watermark without transparency

Post by fmw42 »

I have moved this to the Users forum, since it is about Imagemagick command syntax.

Why the "+" signs? They are not used in command line imagemagick.

What is your IM version and platform? Please always provide that information, since syntax may vary.

try

Code: Select all

convert 2017-01-08-21_38_37-00.jpg watermark.png -gravity southeast -compose over -composite result.jpg
or

Code: Select all

convert 2017-01-08-21_38_37-00.jpg watermark.png -gravity southeast -define compose:args=100 -compose dissolve -composite result.jpg

Best to use convert ... -compose over -composite syntax rather than the older less flexible composite.

See
http://www.imagemagick.org/Usage/compose/#compose
http://www.imagemagick.org/Usage/layers/#convert
djconcept
Posts: 3
Joined: 2017-01-08T14:41:46-07:00
Authentication code: 1151

Re: Image with watermark without transparency

Post by djconcept »

Thank you very much! (Thank you for moving the post)

The + signs, it is the code (python) to generate the names of the files.

I use a raspberry with raspbian. ImageMagick 6.8.9-9 Q16 arm 2016-11-27

Now I have another small problem...

The result image is the size of my watermark.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Image with watermark without transparency

Post by snibgo »

djconcept wrote:The result image is the size of my watermark.
To debug your command, we need to see it. I suspect you haven't followed Fred's suggestion.
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Image with watermark without transparency

Post by fmw42 »

I do not understand. That did not happen with my command, if you are using the same images. So there is something still wrong with your code. Can you test that without and variables? Just use your two images in a simple direct command line command without adding all the python extra variables? If that fails, then provide your code again. Did you use convert or composite commands. Did you try my command? Note that image order is different with convert syntax than with composite syntax. See http://www.imagemagick.org/Usage/compose/#compose

Are you running your command via PythonMagick or somehow with only Python? If the latter, how are you doing that?
djconcept
Posts: 3
Joined: 2017-01-08T14:41:46-07:00
Authentication code: 1151

Re: Image with watermark without transparency

Post by djconcept »

I'm really really sorry, in fact, your command works perfectly.

I was wrong with my variables.

Now i used

Code: Select all

convert /home/pi/drive_ext/1.jpg /home/pi/drive_ext/w.png -gravity southeast -compose over -composite /home/pi/drive_ext/out.jpg
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Image with watermark without transparency

Post by fmw42 »

No need to be sorry. Glad you got it straightened out.

But I am still curious how you are invoking the command via Python. Would you clarify, please? Are you using PythonMagick or just Python. If the latter, then how do you invoke an IM command from Python.
Post Reply