I have scanned a signature and that looks like this

Scanned signature

I want to smooth it. I saw this post where they do this using Photoshop or GIMP.

I tried to replicate that in Mathematica so I can automatize the process since I have to run this on 50+ signatures.

What I did was

image = Import["path/to/my/image"];

ImageResize[Threshold[  GaussianFilter[ImageResize[image, Scaled[2]], 5], {"Hard", "Cluster"}], 400]

And got this

Processed signature

It looks smoother but also a little bit blurry. I think I got a better result with GIMP but it will take a lot of time if I do that by hand 50+ times.

This is what I got with GIMP

GIMP result

Any idea how to improve this?


I got something a little bit better


This gives me

Better result

Part of this came from this post.

  • $\begingroup$ Please include the "desired" (GIMP) result image $\endgroup$ – Dr. belisarius Apr 12 '15 at 1:25
  • 1
    $\begingroup$ Just in case GIMP has a batch mode $\endgroup$ – Dr. belisarius Apr 12 '15 at 1:32
  • $\begingroup$ Added GIMP result. I'll take a look at GIMP batch mode but would like to do it with Mathematica too. $\endgroup$ – xtian777x Apr 12 '15 at 2:53

You probably won't achieve exactly the same effect in Mathematica as you will with GIMP, but I think this is pretty close:

  MeanShiftFilter[ImageAdjust[ImageAdjust[image, {0, 0, 2}]], 
   5, .1], {1, 0}], "Grayscale"]

Mathematica graphics

  • $\begingroup$ Sweet! I'll take this as a reference and try to improve it. Thanks so much! $\endgroup$ – xtian777x Apr 14 '15 at 1:03

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.