Imagemagick - add a text and a picture as watermark to a pdf with opacity

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
suman114
Posts: 13
Joined: 2016-04-17T23:51:39-07:00
Authentication code: 1151

Imagemagick - add a text and a picture as watermark to a pdf with opacity

Post by suman114 »

I am trying to add water mark as follows. But the image is fully solid. Can I make it semi-transparent or have some opacity?
The command is follows.

Code: Select all

convert file/location.pdf null: logo.png -gravity center -quality 100 -fill "rgba(180,180,180,0.80)" -pointsize 18 -weight bold -annotate +0+50 'Something Stupid here' -compose multiply -layers composite destination.pdf
Can anyone help me pipe composite to this or fix this command?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Imagemagick - add a text and a picture as watermark to a pdf with opacity

Post by snibgo »

Which image is the watermark you want to make transparent? If it is logo.png, then:

Code: Select all

convert file/location.pdf null: ( logo.png -alpha set -channel A -evaluate Multiply 0.8 +channel ) -gravity center -quality 100 -fill "rgba(180,180,180,0.80)" -pointsize 18 -weight bold -annotate +0+50 'Something Stupid here' -compose multiply -layers composite destination.pdf
If using bash, escaps the parentheses like this: \( \).
snibgo's IM pages: im.snibgo.com
Post Reply