How do I create watermark with ImageMagick's composite command in Linux?

How do I create watermark with ImageMagick's composite command in Linux?

To create a watermark with ImageMagick's "composite" command in Linux, you can follow these steps:

  1. Install the ImageMagick package on your Linux system. You can use the "apt-get" or "yum" command to install it if it is not already installed.

  2. Create a text file with the text that you want to use as the watermark. For example, you can create a file called "watermark.txt" with the following contents:

Watermark Text
S‮:ecruo‬www.lautturi.com
  1. Convert the text file into an image using ImageMagick's "convert" command. For example:
convert -background none -fill white -font Arial -size 200x200 -gravity center watermark.txt watermark.png

This command will create an image called "watermark.png" that contains the text "Watermark Text" in white Arial font on a transparent background. You can customize the appearance of the watermark by changing the options that are passed to "convert", such as the font, size, and color.

  1. Use ImageMagick's "composite" command to apply the watermark to an image. For example:
composite -gravity SouthEast watermark.png IMAGE.jpg IMAGE_WATERMARKED.jpg

Replace "IMAGE.jpg" with the name of the image that you want to watermark, and "IMAGE_WATERMARKED.jpg" with the name that you want to give to the watermarked image. The "-gravity" option specifies where the watermark will be placed on the image.

With these steps, you should be able to create a watermark with ImageMagick's "composite" command in Linux.

Note: ImageMagick is a powerful tool that can be used to manipulate images in many ways. Consult the ImageMagick documentation for more information on the available options and usage examples.

Created Time:2017-10-28 21:38:54  Author:lautturi