Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How To Remove the Lines and Boxes On A Form?
#1
I have a form with graphic data filled in it, and I have the blank form. I'd like to somehow use GIMP to remove the form's boxes and lines, so that ALL that's left is the graphic data. The form is printed in blue, while all the data is black.

I tried removing the blue color from a scan of the completed form, but the graphics overlay the lines, and it became a pixel-by-pixel struggle - and so error prone that I gave up.

Is there a way to use a scan of the blank form as a mask to remove the printed info from the form (lines, boxes, labels, etc.) from a completed form?

Here's an example (not precisely the same thing, but it's close) of the kind of form I'm talking about (sorry for the size of the image):
[Image: fbi-fingerprint-application-form-fd-258-...83x683.jpg]
And a filled example:
[Image: fbi-fingerprint-application-form-an-comp...ars-in.jpg]
Thanks in advance!
Reply
#2
Did you not ask CSI for a one click-fix. Wink  Every operating system listed but no mention of the version of Gimp you are using. Best demonstrated in Gimp 2.10

Your blank form is smaller in pixel size to the filled in form. You will need to scale it up. You could do that by eye, but a bit of measuring gives a scale factor of 186.82%. Then what do you do with it? Selection & cut can remove the white. Selection inverted and grown can replace the blue with something more solid and allow some overlap. That gave me a less-than-wonderful overlay. attached for you to play with. Put it on top and set the layer mode to erase.

Other ways? Colors -> Map -> Color Exchange easier to show in Gimp 2.10 than Gimp 2.8

[Image: W7XBARn.jpg]

and a little 2 minute video demo, both overlay and color exchange:  https://youtu.be/3foMwWWAUYo


Attached Files
.gz   overlay.xcf.gz (Size: 73.89 KB / Downloads: 177)
Reply
#3
If we have an empty form and a filled in form it should be possible to filter the form out.
I get this effect by putting the empty form on top and the filled in at the bottom, then put the top layermode to 'Color Erase' or 'Divide'.

Of course this requires the two forms to line up 100% (which could be done with the 'Unified Transform Tool' and the 'Difference' mode).
Reply
#4
Thanks for the help. I think I have version 2.10 on the machine I'm trying to do this with, but I'm not at that machine to verify it at the moment.

Rich, the examples may not be the same size, but the actual form, filled or blank, is the same size. I just used images I could snag from the Internet to demonstrate with. Your video was extremely informative, and once I get back home and have a go at it, I now have a great deal better idea of how to approach this problem.

Espermachine, your approach is close to what I had envisioned, but I didn't know where to look for just the right tool. That's the problem I've run into with trying to figure out GIMP on my own: there's certainly a tool for everything, but what it's called and where it is are quite problematic.

To both of you, I appreciate your time and helpful suggestions. I hope to get a chance to mess with this in the next couple of days (work and travel allowing), so I can report back what worked and what I had to do to make it happen.
Reply
#5
(11-17-2018, 10:37 PM)ghporter Wrote: Espermachine, your approach is close to what I had envisioned, but I didn't know where to look for just the right tool. That's the problem I've run into with trying to figure out GIMP on my own: there's certainly a tool for everything, but what it's called and where it is are quite problematic.

I'd say you cant figure these things out on your own. Thats why forums are great.
Aligning identical images with the help of the 'Difference' mode is a trick ofnuts teached me for example.

Getting two scans of the same form to line up perfectly can be challenging, even if you position the paper perfectly on the glass, as soon as you close the lid, the airpressure can easily spoil it. I have scanned quite a few images and tried to stitch them together and its not an easy task. Thats why the new 'Unified Transform' Tool is a great addition.

I know that Photoshop has a functionality that aligns images automatically, so maybe there is a script for Gimp that does this, or could be written.
Reply
#6
(11-18-2018, 09:33 AM)Espermaschine Wrote: I know that Photoshop has a functionality that aligns images automatically, so maybe there is a script for Gimp that does this, or could be written.

Not automatic, but Ofnuts has layer aligner that works well and easy to use.
ofn-layer-aligner , available here:
https://sourceforge.net/projects/gimp-to...s/scripts/

A much easier method that may or may not suit the OP is to select the black with the Colour Select Tool; and then paste as a new image. The difficulty comes with the edges of the black where the black tends to fade into a gray. Play with the Threshold to see if a suitable result can obtained. Worth doing a bit of experimenting.
Reply
#7
(11-18-2018, 10:20 AM)Blighty Wrote: A much easier method that may or may not suit the OP is to select the black with the Colour Select Tool; and then paste as a new image. The difficulty comes with the edges of the black where the black tends to fade into a gray. Play with the Threshold to see if a suitable result can obtained. Worth doing a bit of experimenting.

Tried that, didnt work for me.
Can you post an example ?


(11-18-2018, 10:20 AM)Blighty Wrote: Not automatic, but Ofnuts has layer aligner that works well and easy to use.
ofn-layer-aligner , available here:
https://sourceforge.net/projects/gimp-to...s/scripts/

I cant figure out how the script works.

EDIT: i figured it out, but its hard to get 100% accurate, which is a requirement for the "cancel out" method to work.
Reply
#8
(11-18-2018, 10:48 AM)Espermaschine Wrote: Tried that, didnt work for me.
Can you post an example ?

Example attached. Colour Select with threshold 100. Question is: is this good enough for the OP?

Quote:I cant figure out how the script works.
EDIT: i figured it out, but its hard to get 100% accurate, which is a requirement for the "cancel out" method to work.

For anyone else trying to figure out how the script works, example attached.

The left image is the lower layer. The right image is the upper layer.

Draw a single path with nodes ABCD. Zoom in close on each node in turn to position it accurately.

Now select the upper layer. Then Layer > Realign

Note that in this example the angle of the two layers is not exactly the same. And the size are different. This script handles both of these.


Attached Files Thumbnail(s)
       
Reply
#9
(11-18-2018, 10:48 AM)Espermaschine Wrote: EDIT: i figured it out, but its hard to get 100% accurate, which is a requirement for the "cancel out" method to work.

And I thought the doc was enough, with the nice images and everything Smile
Reply
#10
(11-18-2018, 01:39 PM)Blighty Wrote: Example attached. Colour Select with threshold 100. Question is: is this good enough for the OP?

It looks good and the method is nice and simple. Not 100% accurate though, when original and processed image are blended in 'Difference' Mode.

(11-18-2018, 02:03 PM)Ofnuts Wrote: And I thought the doc was enough, with the nice images and everything Smile

I messed up the selection order and several other concepts at first.   Confused

Pretty cool script, btw. It boggles my mind how a path is capable of telling the rotate tool what to do.
Reply


Forum Jump: