Page 1 of 1

Image with watermark without transparency

Posted: 2017-01-08T15:04:56-07:00
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.

Re: Image with watermark without transparency

Posted: 2017-01-08T17:16:03-07:00
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

Re: Image with watermark without transparency

Posted: 2017-01-09T13:34:09-07:00
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.

Re: Image with watermark without transparency

Posted: 2017-01-09T14:13:18-07:00
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.

Re: Image with watermark without transparency

Posted: 2017-01-09T14:15:20-07:00
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?

Re: Image with watermark without transparency

Posted: 2017-01-09T14:55:57-07:00
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

Re: Image with watermark without transparency

Posted: 2017-01-09T16:06:21-07:00
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.