In my class I often need to work with color map images. I would show the image and try to make inferences/observations about different subjects. Often times I need to actually quantify some aspects, but it is always very approximate and somehow vague because the images are provided "as is" and I do not necessarily know their content a priori.

Let's imagine I'm working with two images (*). Is it possible to indicate the computer "learn" the color scale bar so I can click at any point in the map and get the value of altitude at that point? Image 1 is a discrete color scale bar, while Image 2 has a continuous color mapping. I included both examples because maybe there are differences in the approach of how to do this.

So, is there a software/way to do this? Preferably open source. I tried ImageJ and couldn't come up with a decent solution.

Image 1:

Image 1

Image 2:

Image 2

As you can see, the color scale is part of the image in all cases.

(*) I do not own any of these images, just examples I found online to illustrate my point.

  • $\begingroup$ What format is the data in. If it is a "real" pdf you might be lucky and you can easily extract it. $\endgroup$ – El Burro Jan 30 '18 at 16:21
  • $\begingroup$ El Burro, what do you mean "data"? The only input I have is the jpg image. So it is not a PDF, nor real nor imaginary :) $\endgroup$ – terauser Jan 30 '18 at 16:26
  • 2
    $\begingroup$ In python you can transform a jpg into a ndarray. You could then try to extract the values from there. $\endgroup$ – El Burro Jan 30 '18 at 17:14
  • 1
    $\begingroup$ To add to El Burro, first remember to "inpaint" (interpolate away) the text. $\endgroup$ – Emre Jan 30 '18 at 17:26
  • $\begingroup$ Thanks. I was hoping there are ready-made softwares to do this. I know there are programs (and have used them) to digitize plots (eg a XY plot from a JPG): you click at the beginning and at the end of each axis and input the corresponding values. Then you click on each data point and the program automatically gives you the X,Y coordinate of each data point. I was hoping to find something like this, does it make sense? $\endgroup$ – terauser Jan 31 '18 at 13:52

Maybe You can try some workaround (first manually then programatically):

  1. Convert to grey-scale
  2. Make density map (digital)
  3. Trace=vectorise image with any Inkscape / Illustrator / etc...
  4. Map vector parts with density map values.

You can write js script for Adobe Illustrator (Gimp / probably also) to automate some things. I'm not suggesting to spend money, just play around with demo until you wiil find Ideal Solution.

Also probably You can try any online API from Big4 or new emergers:

Also there are some commercial with free options i.e. imagga - "Sign up for Free: Tag up to 2000 images per month"

You can try DEMO Vector Magic's Desktop edition $295.00 / license One-time charge allows Group shapes by color (unfortunately do not offer special pricing for Academic Institutions or Non-profits)

Also have you tried FreeMat COLORMAP - Image Colormap Function?

| improve this answer | |

You can use something like Color Picker to manually find the HTML or RGB or HSV values.

| improve this answer | |

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.