11-16-2018, 01:54 AM (This post was last modified: 11-16-2018, 10:57 AM by rich2005.
Edit Reason: fixed text formatting
)
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):
11-16-2018, 11:00 AM (This post was last modified: 11-16-2018, 11:00 AM by rich2005.)
Did you not ask CSI for a one click-fix. 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
11-16-2018, 12:52 PM (This post was last modified: 11-16-2018, 12:52 PM by Espermaschine.)
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).
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.
11-18-2018, 09:33 AM (This post was last modified: 11-18-2018, 09:36 AM by Espermaschine.)
(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.
(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.
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.
11-18-2018, 10:48 AM (This post was last modified: 11-18-2018, 01:04 PM by Espermaschine.)
(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: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.
(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