RSS/Atom feed Twitter
Site is read-only, email is disabled

removing the background from a scanned text

This discussion is connected to the gimp-user-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

5 of 5 messages available
Toggle history

Please log in to manage your subscriptions.

removing the background from a scanned text Ed 08 Mar 11:59
  removing the background from a scanned text Claus Cyrny 08 Mar 12:39
   removing the background from a scanned text Ed 08 Mar 14:37
    removing the background from a scanned text Chris Mohler 08 Mar 16:18
  removing the background from a scanned text Claus Cyrny 08 Mar 12:44
Ed
2007-03-08 11:59:36 UTC (about 17 years ago)

removing the background from a scanned text

Hello all,
My knowledge of Gimp and image editing borderlines /dev/null so bare with me please!

Is there a way to make the background transparent so that only the hand written text remain after I have scanned a document... or do I need a tablet?

The document is scanned via xsane so I can have it in multiple formats, TIFF, JPEG, ...

Any help would be apreciated, thanks :) -Ed

Claus Cyrny
2007-03-08 12:39:30 UTC (about 17 years ago)

removing the background from a scanned text

Hi Ed,

Ed wrote:

Hello all,
My knowledge of Gimp and image editing borderlines /dev/null so bare with me please!

Is there a way to make the background transparent so that only the hand written text remain after I have scanned a document... or do I need a tablet?

The document is scanned via xsane so I can have it in multiple formats, TIFF, JPEG, ...

Any help would be apreciated, thanks :)

you could achieve this by selecting the entire scan, copying it into the clip-
board, and then using this copy as a layer mask. I am presuming that the text as such is grayscale; otherwise you could first duplicate the layer (the scan is most likely on the background layer) & then convert it to a grayscale via 'Layer > Colors > Desaturate'.

The following steps would be (there are actually several ways to achieve this, but I'm trying to make it as simple as possible):

1. 'Duplicate layer' (the layer with the scan; the text should be in grayscale
by now; otherwise see above).

2. Invert the colors of the duplicated layer via 'Layer > Colors > Invert'.
(This is, btw, an easy way to invert colors in general.)

3. Copy the inverted channel into the clipboard via 'CTRL + A', 'CTRL + C'.

4. Go to the layer with the scan, and apply 'Layer > Mask > Add Layer Mask...'.

5. Copy the contents of the clipboard into the mask by simply applying 'CTRL + V',
'CTRL + H'.

6. The last step would be 'Layer > Colors Apply Layer Mask...'. This will remove the
background from the scan, leaving only the text. In case that the remaining text
is somewhat 'edgy', applying 'Filters > Blur > Blur' after step 1. can probably help.

HTH,

Claus

Claus Cyrny
2007-03-08 12:44:42 UTC (about 17 years ago)

removing the background from a scanned text

P.S.:

To keep the transparency, you should finally save the text either as TIFF, PNG, or XCF. JPEG doesn't support transparency.

Claus

Ed
2007-03-08 14:37:09 UTC (about 17 years ago)

removing the background from a scanned text

On Thursday 08 March 2007 12:39, Claus Cyrny wrote:

6. The last step would be 'Layer > Colors Apply Layer Mask...'. This will remove the
background from the scan, leaving only the text

Hello Claus,
Many thanks for your help... I got as far as point '6' but I can't seem to find any variant of 'Layer > Colors Apply Layer Mask...'

The layers I have now are: Floating selection (pasted layer) - hi lighted! Background copy
Background

I can see the image is shown without a background but I just can't finalize the process... your thoughts?

Thanks, -Ed

Chris Mohler
2007-03-08 16:18:40 UTC (about 17 years ago)

removing the background from a scanned text

On 3/8/07, Ed wrote:

On Thursday 08 March 2007 12:39, Claus Cyrny wrote:

6. The last step would be 'Layer > Colors Apply Layer Mask...'. This will remove the
background from the scan, leaving only the text

Hello Claus,
Many thanks for your help... I got as far as point '6' but I can't seem to find any variant of 'Layer > Colors Apply Layer Mask...'

"Layers Menu" > Apply Layer Mask ( I think). Check for a little triangle on the layers dialog - that will give you access to the Layers menu.

I would tackle your image this way (As Claus pointed out, there's usually more than one way):

1. Layers Menu -> Add Alpha Channel 2. Select -> By Color -> click on the background 3. CTRL-K or Edit -> Clear

Check the tool options for select by color (step #2) - they have sane defaults, but you might have to adjust the threshold or feather.

HTH, Chris