Capturing old NCR forms

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
OldGuyJeff
Posts: 2
Joined: 2018-04-10T09:51:16-07:00
Authentication code: 1152

Capturing old NCR forms

Post by OldGuyJeff »

I have a job to scan some NCR (No Carbon Required) forms from the mid-70's for OCR. The dot-matrix blue type has faded, so I've scanned samples as color and set the options to render the type as a redish purple. This causes my paper background to be yellow.

I want to convert it to binary TIFF with the dark parts of my red text going to black, yellow converting to white and the black form stays at black.

I've been dabbling with "-type greyscale" and "-type bilevel", but I think I need to finesse the thresholds of the individual colors. I'm starting to work with "-gamma", but it's hit and miss for me at this time.

I'm testing this on CentOS Linux, using ImageMagick 6.7.8-9 and executing the conversion using a bash script
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Capturing old NCR forms

Post by fmw42 »

Please post an example image to some free hosting service such as dropbox.com and put the URL here so we can see what is actually happening and offer suggestions.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Capturing old NCR forms

Post by snibgo »

Some samples might help us understand the problem. "-level-colors" might be helpful. See http://www.imagemagick.org/script/comma ... vel-colors

In general, finding the process that gives maximum separation (to black and white) is a good idea. Eliminating any resulting grays may not be such as good idea, as it can reduce legibility. But it depends on the goals, of course.
snibgo's IM pages: im.snibgo.com
OldGuyJeff
Posts: 2
Joined: 2018-04-10T09:51:16-07:00
Authentication code: 1152

Re: Capturing old NCR forms

Post by OldGuyJeff »

Unfortunately, they are W2s/tax forms. By the time I take out the confidential company information and recipient information, I'm left with nothing.

I'll try to make a dummy version that I CAN post.
  • I'm going to try rescanning the sample files to see if I can create darker type at the scanner.
  • I've been dabbling with the files in GIMP, trying to see what options help. Dropping the saturation (removing color, but leaving contrasting objects) has promise, but I don't immediately see options like that in IM.
  • I'm also going to experiment with pulling out the red channel only, which is where my variable data is located. That is what I want to extract.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Capturing old NCR forms

Post by fmw42 »

You can change saturation using -modulate B,S,H. See https://www.imagemagick.org/Usage/color ... color_mods. You can change brightness and contrast with -brightness-contrast. You can change contrast with -sigmoidal-contrast.

You can clean the background if not pure white using my script, textcleaner at my link below. Or you can use Imagemagick's -lat (possible with -negate on either side depending upon whether black text on white background).
Post Reply