title: Use Java to identify lines in a graph
body: <p>I am working on an idea wherein I have to identify lines in a JPG or PNG file. The PNG file contains one graph of a single value - one x,y combination. For example, the graph looks like Y = mx+c. 
  I would like to identify the line in the graph  - if I can indentify the position of the pixel in the frame, I believe I can get back the values (x,y) which were used to plot the graph. The assumptions here is - I know the scale i.e 1 pixel = what unit of Y ?
  Can somebody please help me to write a code which will identify the pixels of a specific color in one PNG file?</p>
  
  <p>EDIT</p>
  
  <p>Lets take an example to make it clear. Lets say I have a set of data values X and Y like this -</p>
  
  <pre><code>X = 1, Y = 10
  X = 2, Y = 20
  X = 3, Y = 30
  X = 4, Y = 40
  X = 5, Y = 50
  X = 6, Y = 60
  </code></pre>
  
  <p>In this case, if I use jfreechart type of charting tool and make a chart, it tools like a straight line. </p>
  
  <p>So the input is the dataset and output is the .PNG file (using jchart or jfreechart) containing this line graph for Y values.</p>
  
  <p>Question is - if we reverse the flow, can we develop one program which will take the PNG file (that contains the graph) and give me back the dataset.</p>
  
  <p>The context of the problem is -- I want to store the PNG files in my application and not the raw dataset. But given a PNG file, I should be able to get back my dataset.</p>