I want to create an image like this: From an image like this:
I had some trouble processing the second image you posted above. Since it's in JPEG format, the image compression seems to have made the lines and text fuzzy, and that complicates thresholding it in the way that you want.
I instead went back to the indexed-color GIF image you posted on the previous related question, converted it to grayscale (using the function IND2GRAY from the Image Processing Toolbox), then converted that to a reversed black and white image to match the format of the first image you posted above. Here's the code I used:
[X,map] = imread('original_chart.gif'); %# Load the indexed color image
img = ind2gray(X,map); %# Convert the image to grayscale
reversedImage = img < max(img(:)); %# Convert to reversed black and white
And here's what reversedImage
looks like: