1

Let's imagine I have an image of a simple object with 2 or 3 (or more) different areas of different color.

Now imagine I "draw" a line (transect) or use a tool producing a "virtual" line over the object, parallel to Y-axis (or any other angle).

I want to get coordinates of points (of line) where there is a change in color; and / or, the distance among those points.

Is there any gimp plugin for that, or for other software like imageJ?

4
  • this to specific for a plugin - and has a major problem in that in a "real world" image, like a photo, color differences perceived to the eye are not so sharp as to be automatically distinguished. – jsbueno Sep 9 '20 at 16:58
  • since you have GIMP in your pipeline, my suggestion is for you to use GIMP's measure tool manually - and if you really have a use case to automate that, to use a stack like Python + OpenCV. docs.gimp.org/2.10/en/gimp-tool-measure.html – jsbueno Sep 9 '20 at 17:00
  • you mean develop a gimp plugin? or just python with opencv. what could be more easy considering I want to manually draw the line? – Ferroao Sep 9 '20 at 17:55
  • (comments re-hashed as an answer) – jsbueno Sep 9 '20 at 19:29
1

(Since there is already more than one hint, I am moving the comments to an answer): I think this is too specific for a plugin - and has a major problem in that in a "real world" image, like a photo, color differences perceived to the eye are not so sharp as to be automatically distinguished.

Since you have GIMP in your stack, my suggestion is for you to use GIMP's measure tool manually - and if you really have a use case to automate that, to use a stack like Python + OpenCV. https://docs.gimp.org/2.10/en/gimp-tool-measure.html

you mean develop a gimp plugin? or just python with opencv. what could be more easy considering I want to manually draw the line?

If you want to manually draw the line, then a GIMP plugin would be easier. But in that case, that is an extra argument of manually taking note of the distances with the measure tool.

If you opt to try the plug-in anyway, I'd suggest abusing the "path tool" for drawing the line (a straight, degnerate case of a bezier curve, created with two simple clcks with the path tool), before calling your plugin code - that way the line coordinates are a given for the plugin, using the path API.

I have a nice script I made more than a couple years back that uses the Path Tool in this way to capture 3 points and draw a circle through them - this might be a starting point for you:

https://gitlab.com/gwidion/old-gimp-plugins/-/blob/master/circle.py

1
  • (otherwise, a nice side effect of your question was me visiting this code - it was not versioned on the internet since July, when Atlassian removed all Mercurial repositories from bitbucket. I just re-uploaded it to gitlab) – jsbueno Sep 9 '20 at 19:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.