# Alternatives to rmagick?

**URL:** <https://www.ruby-forum.com/t/alternatives-to-rmagick/177644>\
**Category:** Rails\
**Created:** [October 21, 2009, 2:20pm UTC](https://www.ruby-forum.com/t/alternatives-to-rmagick/177644 "2009-10-21T14:20:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![eltercero](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/e99b99/32.png) [@eltercero](https://www.ruby-forum.com/u/eltercero)\
**Post date:** [October 21, 2009, 2:20pm UTC](https://www.ruby-forum.com/t/alternatives-to-rmagick/177644/1 "2009-10-21T14:20:46Z")

</div>

Hi there,

Is there any real alternative to RMagick? I need to compose some texts  
to an image, so I don’t really need anything really complex.

---

<div class="post-metadata">

**Author:** ![eltercero](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/e99b99/32.png) [@eltercero](https://www.ruby-forum.com/u/eltercero)\
**Post date:** [October 21, 2009, 3:45pm UTC](https://www.ruby-forum.com/t/alternatives-to-rmagick/177644/2 "2009-10-21T15:45:11Z")

</div>

On 21 Oct 2009, at 14:20, Victor M. wrote:

> Is there any real alternative to RMagick? I need to compose some texts  
> to an image, so I don’t really need anything really complex.

ImageMagick through the command line?

From [IBM Developer](http://www.ibm.com/developerworks/library/l-graf/?ca=dnt-428:)

Adding textual annotations to an image  
Sometimes you need to add textual annotations to an image. For  
example, imagine that your company has a standard business card image  
and wants to put each employee’s details onto the card before sending  
it to the printer. Another example is generating presentation  
certificates for users who pass an online course on your Web site.  
Let’s say you start with this image:

Figure 6. A picture from Floriade 2002

You could annotate the image with some identifying information using  
the following command line:

# convert -font helvetica -fill white -pointsize 36 \

-draw ‘text 10,50 “Floriade 2002, Canberra, Australia”’   
floriade.jpg comment.jpg  
And here is the result:

Figure 7. An annotated picture from Floriade 2002

This is by far the most complex convert command line I have shown so  
far in the article, so I’ll take some time to explain it.  
-font helvetica sets the annotation’s font to Helvetica. It is  
possible here to specify a path to a font file as well. This example  
badges the image so it can’t be reused by other Web sites without  
permission, but it does so using a font that is in a non-standard  
location:

# convert -font fonts/1900805.ttf -fill white -pointsize 36 \

-draw ‘text 10,475 “[stillhq.com](http://stillhq.com)”’   
floriade.jpg stillhq.jpg  
This is the result:

Figure 8. A badged image

-fill white fills the letters with white instead of the standard black.  
-pointsize 36 specifies the size of the letters, in points. There are  
72 points to an inch.  
-draw ‘text 10,50 “…”’ is a set of drawing commands, in this case to  
move to the position 10, 50 and then draw the text in the double  
quotes. The single quotes are used because the double quotes are  
needed within the drawing command if more than one word is to be  
drawn, and you cannot have double quotes within double quotes.

Best regards

Peter De Berdt

---

<div class="post-metadata">

**Author:** ![eltercero](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/e99b99/32.png) [@eltercero](https://www.ruby-forum.com/u/eltercero)\
**Post date:** [October 21, 2009, 6:56pm UTC](https://www.ruby-forum.com/t/alternatives-to-rmagick/177644/3 "2009-10-21T18:56:02Z")

</div>

> Is there any real alternative to RMagick? I need to compose some texts  
> to an image, so I don’t really need anything really complex.

- As someone else pointed out, ImageMagick via the command line.
- I think GD has ruby bindings ([http://www.libgd.org/Font](http://www.libgd.org/Font))
- netpbm has some stuff as well I believe…

-philip
