How to tile and resize?

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
etrader
Posts: 16
Joined: 2012-09-29T06:53:04-07:00
Authentication code: 67789

How to tile and resize?

Post by etrader »

I want to add text watermark on an image, and thus, used this code

Code: Select all

convert -size 140x80 xc:none -fill grey \
          -gravity NorthWest -draw "text 10,10 'Copyright'" \
          -gravity SouthEast -draw "text 5,15 'Copyright'" \
          miff:- |\
    composite -tile - original.png watermarked.png
Since I need to resize/convert the image as well, I modified the code to

Code: Select all

convert -size 140x80 xc:none -fill grey \
          -gravity NorthWest -draw "text 10,10 'Copyright'" \
          -gravity SouthEast -draw "text 5,15 'Copyright'" \
          miff:- |\
    composite -tile - original.png -resize 1024x watermarked.jpg
but tile does not work. Only two text annotations appear exactly at NorthWest and SouthEast.

How can I resize when adding tiled watermark?

snibgo
Posts: 12682
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: How to tile and resize?

Post by snibgo »

What version of IM, on what platform?

With IM v7.0.8-64, replacing your "convert" with "magick", and your "composite" with "magick composite", it works fine, with tile and resize. If you want to resize original.png before tiling, put that in parentheses:

Code: Select all

 ... ( original.png -resize 1024x ) ...
snibgo's IM pages: im.snibgo.com

Post Reply