O'Reilly logo

ImageMagick Tricks by Sohail Salehi

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Deformations

Besides drawing and painting abilities there are some parameters that can be used for image deformations. For example with the implode option we can suck or blow the pixels of an image. Here is its usage:

convert {input image} implode value {output image}

Positive values suck the pixels and negative ones blow the pixels of the image. The option works on drawings too. See the following example:

convert size 200x70 xc:darkred -fill white draw 'roundrectangle 5,5 195,65 5,5' -fill black -pointsize 35 draw "text 12,45 'i m p l o d e'" -implode 0.5 implode.gif

This command first creates text on a white background with a red border (Fig 3-13a) and then implodes it by 0.5 (Fig 3-13b).

Fig 3-13: Implode Option

There is a little tip about ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required