Yes, you can add some code to your Web pages that makes it that our friend ImageMagick is terrific at creating these watermarks in a variety. Basically, all that you need to add a watermark to an image is the compositeImage method from an image object. This method allows you to. Need to protect your image files with watermarks? Learn what makes an effective watermark and use the Imagick extension to easily add one to.

Author: Kigam Gara
Country: Burkina Faso
Language: English (Spanish)
Genre: Photos
Published (Last): 21 January 2007
Pages: 112
PDF File Size: 11.56 Mb
ePub File Size: 7.10 Mb
ISBN: 545-2-13102-959-3
Downloads: 84904
Price: Free* [*Free Regsitration Required]
Uploader: Mokree

GlennRanders-Pehrson, can you give a more complete example of the method you are water,ark If the watermark is intended to be applied to only a couple of different image sizes, then I suggest saving out versions of the watermark suited to those sizes of images.

How to add a Watermark to an image with Imagick in PHP

The above parameters can be added to a resize command to add the wanted border around the image. The ” -tile ” option above only works for compose operations using the ” composite ” command. See Polaroid Image Transformation for an example of this.

The coordinates given in the method are totally up to you, as your wish of watermark could be different on wwatermark entire image or just in a corner of the image.

So in this example I am using a 20 pixel border left and right, and an 18 pixel border top and bottom.

How to automatically watermark or batch watermark photos using ImageMagick

The annotation may be bold and highly visible, or subtle and hidden. Of course in that case you may want to make the watermark even less intrusive. Sign up or log in Sign up using Google. Can you recommend any other programs rather than irfanview to do this, if its not possible to do it in imagemagic program.


This is usually what is more commonly referred to, when you ‘watermark’ an image. By night, he freelances as a writer and editor. The details of these methods are given in Alpha Compositing Examples Page. You can open images from a path by creating a new instance of the Imagick class and using its readImage method. Full size watermark Note We use the getcwd function of PHP to provide an absolute path retrieve current working directory to Imagick as it usually doesn’t work with relative paths like.

By using our site, you acknowledge that you have read and understand our Cookie PolicyPrivacy Policyand our Terms of Service.

By using our site, you acknowledge that you have read and understand our Cookie PolicyPrivacy Policyand our Terms of Service. Many methods have just their parameter list given. See ” Positioning Images and Text ” below.

Here we create a simple label on a semi-transparent background, and overlay it. Their is however no simple method at this time to set the outline -stroke color of the draw text to its inverse. Here is how I am doing it: I’m finding out slowly imagemagick and I must say it is fantastic.

Label using Montage The montage command in ImageMagick is often overlooked by users as only useful for creating a display of a whole directory of images. Examples In the following examples we’ll show examples of how of how to add a watermark to an image using the following watermark the watermark could be logo of Our Code World too: As a final example I will overlay a text string created using a fancy soft outlined font to make sure it remains visible, but without creating a rectangular box for the annotation.

However there are more higher level operators that also make use of alpha compositing of images.


Remember that after you save it in a file, you need to change the permissions of the file to allow executing it. Email Required, but never shown. It does work better with a thicker font, than the default ‘ Times ‘ or ‘ Arial ‘ font. Looking for a new template for your next project? While this approach is fine if you know the size of the original images axd since you can create the watermark with the appropriate dimensions, you might want a more robust approach in case the sizes of the watermar images vary.

According to the way you work using a framework or plain PHPthe way in which you provide an absolute path to a file may be vary so heads up! Before you get started, make sure the Imagick extension is available on your host.

Specifying a value of 0x15 means add no columns which would affect the width and add 15 pixels in height.

Insert logo in the photo – ImageMagick

Below imagemwgick can see an example showing plain text watermarks in white and black versus a watermark incorporating a background. Instead you can prepare very complex font image, either before-hand, so you can apply it many times, or on the fly on a per image basis. One thing, it would be possible to apply the inclusion of “logo. However, since I did title this article How to automatically watermark or batch watermark photos using ImageMagickI guess I should show something about how to actually batch add a watermark.

To overlay the watermark image, you use the compositeImage method. June 12, at 8: