Langsung ke konten utama

Postingan

Menampilkan postingan dari Oktober, 2022

Fajar Lazuardi ....

  ImageMagick – Adding Text to an Image 2 months ago by  Kalyani Rajalingham According to ImageMagick themselves, adding a piece of text to an image is not only one of the most basic operations but also one of the most common uses of ImageMagick. Further, there are a few reasons why you would annotate your image: You may wish to add information about the image. You may wish to point out something about the image. You may wish to copyright the image. In this tutorial, we’ll be learning how to add text to an image. Installing ImageMagick We will need ImageMagick for this process, so first let’s install it: sudo   apt-get install  imagemagick Append In the simplest case, you can use the append switch to append a text image to an initial image. convert photo44.jpg    -background  Khaki  -pointsize   50  label: 'LinuxHint'   -gravity  Center  -append  code002.jpg background : color of the background of the text image. Here...

Fajar Lazuardi

  Using ImageMagick:convert:draw:text It is a rather messy business to draw text with the ImageMagick program convert, especially if one needs gravity. The below documents the situation in version 6.0.7. % identify | head -1 Version: ImageMagick 6.0.7 11/03/04 Q16 http://www.imagemagick.org No doubt the current situation is unfortunate and should be improved. The starting picture Let us first create the canvas. #!/bin/sh convert -size 300x300 xc:white -stroke black \ -linewidth 3 -fill white -draw "rectangle 15,15 285,285" \ -linewidth 2 -draw "rectangle 120,80 260,160" \ cv.png This yields the image The four corners of the inner rectangle are (120,80), (260,80), (120,160), (260,160) and the center is (190,120). Center We want to draw text in the center and the four corners of the inner box. Just using the coordinates of the center: convert cv.png -draw "text 190,120 'abc'" test1.png yields with the center of the inner box being the lower left c...