32

I need a tool using which,when i point the mouse at a particular location of an image,it should give me location of the pixel relative to the image.for ex.i have a 720x480 image,my pointer is somewhere on the image,then the tool should tell me it is x pixels from left and y pixels from the top i.e coordinates of the pixel.Please help!Thanks in advance!

androidnewbie
  • 423
  • 2
  • 8
  • 15
  • I'm sure Photoshop does that, and many other image manipulation programs. But note that this is a site for programming questions, not for questions about using software packages. – High Performance Mark Oct 11 '12 at 13:15

2 Answers2

22

In photoshop, the information pannel give you that. I'm pretty sure it's also possible in Gimp.

Or you can make your own tool ! I made you a small example in jsfiddle : http://jsfiddle.net/zz3Rh/19/

The html :

<div id="image">image</div>
    coordinates :
<div id="coordinates">0</div>​

The css :

#image{ height:350px; background:#c00;}​

The js (with jquery loaded) :

$(function(){
    $(document).mousemove(function(e){
        $('#coordinates').html('x: ' + e.pageX + ' y : ' + e.pageY);
    });
})

BECAUSE WEBTOOLS ARE THE FUTURE !!!! :) (and because this is a forum for developpers)

fabien
  • 2,228
  • 2
  • 19
  • 44
  • +1 @fabien hahahaha nice idea. But, it will show x and y as related to the document, not the image :( – Mohammed Joraid Jan 22 '14 at 07:23
  • 2
    nice! I also built a similar tool to get bounding box coordinates: http://nicodjimenez.github.io/boxLabel/annotate.html – nicodjimenez Jun 20 '15 at 08:14
  • Thanks @nicodjimenez. Your tool is awesome! – Khurram Aug 20 '17 at 19:00
  • @nicodjimenez That tool is a life-saver and should get some more visibility IMO! There are times, especiall when dealing with object detectors, when I need rough image coordinates for a quick sanity-check – AruniRC Jan 28 '18 at 23:14
14

Almost every image editor program has such a feature. For instance, try opening any image in "The Gimp", and the coordinates you need will show up on the bottom left corner of the window.

If you are using Linux, you can surely install it from your package management application. If you are using OSX, you can download it from http://gimp.org/ and you can also try http://gimp-win.sourceforge.net/ for the latest installers for Windows.

alecu
  • 243
  • 1
  • 5