1

I scanned a line drawing and extracted the line work in Inkscape. I'm trying to clean up the image in Gimp (erasing dust specks and such), but the lines remain a bit jagged. I've tried selecting the lines, shrinking the selection and deleting the rest and I ended up with the result below. I read that blurring and sharpening could work, but it doesn't seem to do much for me? It's not an issue of pixelated edges, for which I found several solutions online. If anyone knows other things I can do to make the lines look a bit smoother, I'm happy to try out those ideas!

closeup

A detail of the original scan: detail I realize the original is not very smooth to start with. I'm just curious how to get the cleanest possible lines out of this drawing.

3
  • The common use of word "jaggy" means that individual pixel edges can be seen as stairs in high contrast borders. Anti-aliasing is used to prevent it. Complex edges in your tracing are the result of not so clean color borders which is typical for scanned drawings. Publish a piece of the original drawing as a grayscale or preferably as a color scan to get some hints for better results (other than redraw it either better on a paper or in your computer).
    – user82991
    Jul 7, 2022 at 13:03
  • @user287001 Actually that's not quite right, jaggy/jagged has a more common meaning of something with rough/sharp protrusions - like a cactus, or a holly bush, or a bush with thorns. It describes the OPs example exactly.
    – Billy Kerr
    Jul 7, 2022 at 17:00
  • There are many words that have had a meaning hundreds of years before pixels and computers. Where I live the most common meaning for jaggy is just what I wrote, because English is used so rarely. But thanks for the rectification.
    – user82991
    Jul 7, 2022 at 17:09

3 Answers 3

2

Another simple Gimp solution:

  • Threshold the image

  • Apply a Gaussian blur so that the irregularities disappear (radius around 10):

    enter image description here

  • Use Curves to restore sharp and smooth edges:

    • Drag the foot of the diagonal to the right to restore the width of the lines
    • Drag the top of the diagonal to sharpen the edges

enter image description here

enter image description here

1

Cleanest possible lines can be got by redrawing simple enough paths manually on your scanned drawing. If the creator of the original image does it the result can well be acceptable also as a piece of art. I skip it, because I actually do not know what's wanted. If someone else with no artistic idea tries to redraw your image the lines and curves can easily be a incompatible - no common style, like everyone was taken from a different image.

Filtering possibilities:

Median filter (GIMP, Photoshop) can remove excessive details. It leaves easily grey remnants at the edges, but one can remove them by increasing the contrast by applying Curves. This is your scanned image still as bitmap, but after median filtering and contrast boost:

enter image description here

One way to make it look more solid is to let a filter remove all curves. The next version is the previous one + Photoshop's Cutout Filter. GIMP has the equivalent if one install's the G'MIC filter collection (see NOTE2):

enter image description here

The corners can be smoothed in Photoshop by selecting the black, refining the selection with high degree of smoothing with big radius and by filling the selection in a new layer:

enter image description here.

If the version which had got median filtering and contrast boost is traced in Inkscape, the result obviously is quite the same that you already have:

enter image description here

In the left there's a traced image and in the right the number of nodes is reduced by applying Path > Simplify. Unfortunately function Simplify does not have other idea than reducing the number of nodes, it's not trying to make the image to look like it's drawn by a somehow more steady hand.

We can make the curves stylistically more uniform by selecting all nodes with the node tool and then making every node to a corner point:

enter image description here

Then we can restore the smoothness uniformly with path effect Corners fillet/chamfer:

enter image description here

Redrawing it in Inkscape manually is the suggestion I prefer, if the image really must be converted to a vector drawing and remove all traces of traditional painting. As said, it's done best by the original artist.

The 2nd best would be a person who has some sense of the wanted style. The rest of us would draw a little too easily something like this:

enter image description here

NOTE2 I'm afraid nothing makes it nice and smooth at the same time automatically. But you have also another direction. Make it more complex. An example:

enter image description here

The leftmost version is your scan filtered with G'MIC collection filter Artistic > Cubism. In the right the left one has got a Gradient Map.

Or this...

enter image description here

As you see, there's no limit to get more and more weird results by splashing together more effects. But the original artist is needed to say what supports his idea.

1

A rather simple solution, all in Gimp:

  • Threshold the image
  • Apply Filter > Blur > Median blur (radius around 10):

enter image description here

If you want to go further:

  • Obtain a selection (Color-select the black), and obtain a path from it
  • use this clever script to simplify the path
  • recreate the image by obtain a selection from the simplified path, and bucket-filling the selection

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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