androidnewbie
androidnewbie

Reputation: 443

tool to get coordinates of an image pixel

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!

Upvotes: 34

Views: 107566

Answers (2)

alecu
alecu

Reputation: 243

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.

Upvotes: 14

fabien
fabien

Reputation: 2258

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)

Upvotes: 24

Related Questions