Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to move (translate) an image by an offset of X, Y on imagemagick?

What's the command that will take an image, move / translate it by an offset of X,Y pixels and save the result?

like image 621
MaiaVictor Avatar asked May 10 '13 22:05

MaiaVictor


People also ask

What is XC in ImageMagick?

Yes it is purely an alias for xc: which stood for "X window color", which came from the extreme early days of ImageMagick (long before my time). Of course color is usually a SVN color rather than X window color, so really the original name is rather useless.

What is ImageMagick command?

Use ImageMagick® to create, edit, compose, or convert digital images. It can read and write images in a variety of formats (over 200) including PNG, JPEG, GIF, WebP, HEIC, SVG, PDF, DPX, EXR and TIFF.

Does ImageMagick have GUI?

ImageMagick does not have a robust graphical user interface to edit images as do Adobe Photoshop and GIMP, but does include – for Unix-like operating systems – a basic native X Window GUI (called IMDisplay) for rendering and manipulating images and API libraries for many programming languages.

How do I crop an image in ImageMagick?

To crop an image using ImageMagick, you need to specify the X and Y coordinates of the top corner of the crop rectangle and the width and height of the crop rectangle. Use the mogrify command if you want the images to be replaced in-place or use the convert command otherwise to make a copy.


1 Answers

You could try something like this:

convert test.png -page +20+20 -background none -flatten newtest.png

where +20+20 represent your x,y coordinates.

like image 100
Andrea Avatar answered Sep 21 '22 16:09

Andrea