Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
measure/record pixel coordinates
#1
I was expecting that somehow when using measure tool I would be able to right-click on a pixel and have single pixel coordinates stored in the clipboard as a numeric string, so I can copy it to a text editor in order to create input for some other program. Is there a way to do this? Is there any other tool with the precise cross cursor that can be used in this mode?
TIA
Reply
#2
Maybe this can help you :
https://www.gimpusers.com/forums/gimp-us...-clipboard
Reply
#3
Linux + gimp 2.4 Which linux ? and is that information correct.

On the assumption it is not Gimp 2.4 Another way.

You can place guides at the end of the measure tool see: https://docs.gimp.org/2.10/en/gimp-tool-measure.html Look for an icon change very near the end of the measure tool.

There is a script listguides.scm from here: http://www.silent9.com/incoming/scripts/ which gives horizontal and vertical co-ordinates.

Might go like this

a.mp4

I use guides a lot. One nuisance is removing them via the menu. Strongly advise setting a keyboard shortcut for this.
Reply
#4
(07-16-2020, 08:01 AM)rich2005 Wrote: Linux + gimp 2.4 Which linux ? and is that information correct.
At this very moment I work with Mint 19.3 and Gimp 2.8.22. However, I am designing a procedure and software for some optical equipment tests, which would be performed by multiple users on their own computers; thus I am looking for a "gimp generic" solution.
 
One such test consists of between 50 and 100 points pixel coordinates from a single image file being recorded in a text file (which is later processed in other software). Gimp (or similar program) is quite useful because it is simple to quickly change image content to (for instance) monochrome green, so that the black cross-shaped cursor stands out quite well.

I was actually expecting that "measure tool" would offer such functionality and that, despite my efforts, I was just unable to figure out how to do it.

Thank you all for helpful comments.

(BTW, where can one just look at the Gimp source code?)
Reply
#5
Maybe use ImageMagick (IM) as well as Gimp. (had to make up an image Smile    )

Define the points on an overlay, pencil tool, size 1 pix, black and export that layer to a png.

   

Using IM from this post: http://www.imagemagick.org/discourse-ser...hp?t=32483

Code:
convert in.png -threshold 50% -depth 1 txt:- | tail -n +2 | sed -n 's/^\(.*\):.*black$/\1/p'

Lists like this:

   

IM has moved, ask questions here: https://github.com/ImageMagick/ImageMagick/discussions

Gimp Code? I suppose you could download the source from (for Gimp 2.8) https://download.gimp.org/mirror/pub/gim...22.tar.bz2
Reply
#6
I have  a script that exports a path as a CSV, so you just have to make a path that goes through all the points you need, then export the path. The CSV likely contains some info you don't need, but it's easier to deleted that than to add it when missing.

http://gimp-path-tools.sourceforge.net/t...l#path-csv


   
Reply
#7
Thanks, useful script, however I did not find a method to change the cursor in path creation tool to a simple cross - just like the cursor in "measure" or "region creation" tool. The level of precision with which a detail on the image must be identified makes it near-impossible to get down to single-pixel precision with anything but cross-shaped cursor.
Reply
#8
(07-16-2020, 07:10 PM)fotomax Wrote: Thanks, useful script, however I did not find a method to change the cursor in path creation tool to a simple cross - just like the cursor in "measure" or "region creation" tool. The level of precision with which a detail on the image must be identified makes it near-impossible to get down to single-pixel precision with anything but cross-shaped cursor.

You can zoom in to your heart's desire (up to 256x). A path anchor point has floating-point coordinates, you can have sub-pixel accuracy.In the image below, the anchor in the red circle is actually two anchors  with less that a quarter of pixel between them.

   
Reply
#9
Thanks, will try this.
Reply
#10
(07-16-2020, 11:30 AM)Ofnuts Wrote: I have  a script that exports a path as a CSV, so you just have to make a path that goes through all the points you need, then export the path. The CSV likely contains some info you don't need, but it's easier to deleted that than to add it when missing.

http://gimp-path-tools.sourceforge.net/t...l#path-csv


Your script is just what we need to measure cell lengths in jpgs (about 50 to 200 cells per image), but I cannot get it to work after hours of trying in GIMP 2.8.22 on an Ubuntu 18.04-based linux distro (GIMP was downloaded with Synaptic from the Ubuntu repros).  To the best of my knowledge, I followed the directions correctly with placing the script into the .gimp-2.8 plugins file.  After multiple restarts of the program and machine, I still cannot get a right-click paths window to see the script.  I cannot even find the window you refer to in the directions.  I premade the .csv file but I cannot link it to the script since I cannot seem to activate it or find it.

I note that many on-line tutorials show different pallets and menus than I have available; e.g. my measure tool lacks many check boxes for vertical, horizontal or straightening.

Do I need to run this script with GIMP in a different OS or use a more updated version?  Since the script directions were written for v. 2.6, that did not seem likely but the menus referred to don't show up.
Reply


Forum Jump: