4

I have this graph below, which shows a readout for an experiment on a graph background like this;

enter image description here

I would like to remove this graph background, leaving just the black line, so that it is formatted like this; enter image description here I tried to do this in powerpoint using the 'remove background' option, thinking that powerpoint would be able to distinguish the black line from the red and white background, but no. I have fumbled about with different options in inkscape and imagej, but am not really sure what to do. I don't have access to adobe softwares, so if answers could apply to inkscape/imagej, that would be greatly appreciated.

4

These are obviously plots on paper. If you can rescan them or take new photos in good light, that really would pay off. Poor contrast and non-uniform light makes all quite tiresome. Uniformly lighted high contrast images are easily traced in Inkscape but these will provide garbage. Two workarounds are already shown:

  • trace in pieces and combine
  • draw it with the pen

I suggest doing the job in a photo editor (Photoshop, GIMP) as a way out having only that one image:

  1. Make the red graticule as light as possible and desaturate it. Use Hue/Saturation tool selectively. Adjust the saturation to the minimum, find the range selector slider positions which take all of the red and drag the lightness slider to maximum:

enter image description here

  1. There's still left much remnants of the graticule. Fortunately they everywhere have finer grain and they are lighter than the curve - at least when compared to the nearest part of the curve. Apply Filter > Blur > Smart Blur to smooth fime grains but leaving strong local contrasts intact (two images, one for settings and another for the result):

enter image description here

enter image description here

This can already be useful, but let's make it closer to the ideal (=black curve on white background). Tresholding cannot be applied because the brightness is too different in left and right. It must be balanced, add brightness to the darker areas. This can be done in several ways:

  • insert a gradient layer with blending mode = Add.
  • the same, but create the gradient by making a heavily blurred and inverted copy, fix the edges manually
  • insert an adjustment layer for levels or curves and find the balance with gradient in layer mask

Let's try the first version. Have a gradient from black (left) to 50% grey (right) in a new layer that has blending mode =Add:

enter image description here

That needs a little fine-tuning. Spray to the gradient a little black with large smooth low opacity brush to take back the overwhitened top right corner.The unwhitening is done most easily after the next step:

Add a levels layer to lift light grey to white and pushing the dark grey down to black:

enter image description here

There are still a couple pieces of garbage, but they are far from the curve. Use eraser to fix them.

Finally, if it's wanted, it can be traced in Inkscape. Single treshold BW won't be ok, because there are greyshades => Tracing mode should be greyscale with at least 4 levels.

2

I didn't initially notice the tag, though I'm sure it has similar (if not same) tools and it could work.


I would use Photoshop and adjust the levels.

If you first convert the image to grayscale (Image → Mode → Grayscale) there won't be any color

Now doing this will leave some color there.

enter image description here

Using Black and white filter to remove the excess coloring (I dragged the yellows and reds to white)

enter image description here

Now use some manual touch up (brush work or eraser) to get this:

enter image description here

  • To the downvoter: feel free to comment your problem with my answer. – WELZ Jan 24 '18 at 18:34
  • 1
    I didn't downvote and I would also use something like Photoshop or the Gimp, but I can imagine that it was downvoted because it does not answer the question: how to do that with Inkscape. – Rudy Velthuis Jan 24 '18 at 19:16
  • I used the inkscape greyscale tool with similar results, you can get rid of the grid by adjusting the lightness, but the graph lines fade out a bit by that point – TDavis Jan 25 '18 at 1:32
1

Try using the pen tool.

Looks like Inkscape has a pen tool similar to Illustrator's.

Place your image in Inkscape and lock it down (if you can). Then take the pen tool and "trace" the image. Do this by clicking each point to form the shape on the graph paper.

This might take you a bit to get done, but the result should be what you're looking for.

  • Plain and simple. It could probably be done quicker in Photoshop/GIMP, but it would take some experimenting and the result would be a little bit "eroded". This might take some time but every click will get you closer to the goal. – Wolff Jan 24 '18 at 17:25
  • @wolff I'm sure it would be quicker with other software, but the pen tool will produce the cleanest and "most usable" result. – Ashlee Palka Jan 25 '18 at 16:22
1

It's certainly possible in Inkscape. However the main problem is that the original image is darker at one side than the other.

If you trace the bitmap image using Path > Trace Bitmap, choose the Brightness Cut Off option, you can alter the Threshold. But I had to create two copies using different Thresholds to get an acceptable trace of each side.

Then it's a simple case of using a clipping mask made from a rectangle to create two acceptable halves, which can then be put together.

enter image description here

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.