Normalizing colors of a scanned image

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
ebr4him
Posts: 13
Joined: 2015-07-20T13:50:23-07:00
Authentication code: 1151

Normalizing colors of a scanned image

Post by ebr4him »

I have this scanned image in low-res:
Image
Image

I need to sharpen the text, smoothen it, clear the noise around it, and for any colored (red title, border especially) elements, ideally I want to convert them to a single solid color, or reduce colors as much as possible so its looks better.

I tried

Code: Select all

convert 003.jpg -alpha off -auto-level -normalize -level 10%,90% -sharpen 0x1 -fuzz 50% -strip -quality 70 -colors 16 -brightness-contrast -5x20 -resize '720' -selective-blur 0x4+10%  003a.jpg
but it doesn't seem to work:

Image



I'd appreciate any help! Thanks.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Normalizing colors of a scanned image

Post by fmw42 »

Please always provide your version of IM and platform. Syntax is different for Windows and Unix as is scripting.
ebr4him
Posts: 13
Joined: 2015-07-20T13:50:23-07:00
Authentication code: 1151

Re: Normalizing colors of a scanned image

Post by ebr4him »

Oh ok.

6.9.1-6 Q16 x86_64 on Mac
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Normalizing colors of a scanned image

Post by fmw42 »

Oh ok.

6.9.1-6 Q16 x86_64 on Mac

Please read viewtopic.php?f=1&t=9620 which is the very top link in the Users forum


If you want to reduce colors, then see -colors or -remap.

http://www.imagemagick.org/Usage/quantize/#colors
http://www.imagemagick.org/Usage/quantize/#remap

or try my script, kmeans, at the link below.

For noise removal, see -despeckle or -enhance.

http://www.imagemagick.org/script/comma ... #despeckle
http://www.imagemagick.org/script/comma ... hp#enhance

or try some of my noise reduction scripts at the link below.

I do not think -morphology open or close will help without disturbing your text.

To sharpen, see -unsharp.
ebr4him
Posts: 13
Joined: 2015-07-20T13:50:23-07:00
Authentication code: 1151

Re: Normalizing colors of a scanned image

Post by ebr4him »

Thanks for the links, however noise reduction and sharpening are least of the problem, I can achieve that easily but its the color 'normalization' that I want.

If you see the border, its different on all sides, light on top, dark on left and normal on bottom and right. Not sure how to 'normalize' it. Tried a lot of things including fuzz, dither etc, but can't get the combination right.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Normalizing colors of a scanned image

Post by snibgo »

The main problem is that the paper has been burnt out ("clipped") to white. This makes automated correction of tones and colours more difficult. Was this whitening done by the scanner, or by later software?

The next problem is that the images have been compressed with JPEG, which heavily degrades image like this that have solid colours.

If you have better quality sources, the job is much easier.
snibgo's IM pages: im.snibgo.com
Post Reply