Notice! This document is currently in Archived status.
The content of this document may be incorrect or outdated.

Print this article Edit this article

XY coordinates using imagemagick

Purdue Engineering Computer Network

About ImageMagick

Imagemagick is an interactive image display package used in X Windows. The package includes tools for image conversion, annotation, compositing, animation, and creating montages. ImageMagick can read and write many of the popular image formats (e.g., JPEG, TIFF, PNM, XPM, etc..) The ImageMagick suite of programs are installed in the /usr/local/bin/magick directory. This directory is not in the standard path. For more information about ImageMagick, type:
	man ImageMagick

How to find the x,y coordinates

  1. To view your GIF file via ImageMagick, simply type:
    	display foo.gif
    This is assuming you have the ImageMagick path set in your environment correctly as per the instructions of the ImageMagick manual page.

    If you did not edit your environment to keep ImageMagick permanently in your path, then type:

    	/usr/local/bin/magick/display foo.gif
  2. Click the LEFT mouse button in the image to bring up the menu of things you can do.

  3. Using your LEFT mouse button, select Image Edit and drag to the right. Then select Region of Interest and release. Alternatively, press R in the Image window.

    The ImageMagick menu will now contain a menu which contains the items, Help and Return.

    The x,y coordinates can be viewed by positioning the pointer anywhere within the image. The coordinates appear in a box in the upper left corner of the window. These coordinates will change as you scroll around the image.

    For example, to determine the coordinates of a rectangle, you need two coordinates pairs; upper-left and lower-right. So move the pointer to the upper left corner of the shape and write down the two numbers you see in the upper left corner box. The numbers in the box will look something like this:

    	+119+158
    The x,y coordinates are 119,158. Then go to the lower right corner of the shape and write down the numbers you see in the upper left corner box.

    Now you have your two pairs of x,y coordinates to map your image.

You follow the same procedure to determine x,y coordinates for a circle and polygon, remembering the circle needs two coordinate pairs (center and edgepoint) and a polygon needs coordinate pairs for each vertex.

Last Modified: Dec 19, 2016 11:12 am US/Eastern
Created: Mar 21, 2007 12:01 pm GMT-4 by admin
JumpURL: https://eng.purdue.edu/jump/ca3e1