Results 1 to 10 of 10

Thread: Modifying image to remove background behind text

  1. #1
    IV Newbie
    Join Date
    Apr 2020
    Posts
    4
    Version
    IrfanView 4.51
    OS
    64-bit Win 10

    Question Modifying image to remove background behind text

    I'm a big IrfanView fan and have been using for many years.

    If I have a picture of a recipe in a newspaper for example, which just has text and no pictures, typically the background is non-white after the scan/photo.

    I would like to be able to make the background all white. That way if later printed there is no toner being used other than that for the text.

    Is there a way of modifying an image to achieve this?

  2. #2
    Moderator Enterprise User Bhikkhu Pesala's Avatar
    Join Date
    May 2007
    Location
    East London
    Posts
    6,643
    OS
    64-bit Win 10
    CPU Cores
    1

    Default

    An easy way is to use Gamma correction and Contrast = Shift+G.

    Click image for larger version. 

Name:	Before.jpg 
Views:	23 
Size:	351.9 KB 
ID:	6062Click image for larger version. 

Name:	After.jpg 
Views:	22 
Size:	320.0 KB 
ID:	6063
    Last edited by Bhikkhu Pesala; 08.01.2021 at 07:50 PM.

  3. #3
    Power User j7n's Avatar
    Join Date
    Jun 2006
    Location
    Cyberspace
    Posts
    570
    Version
    IrfanView 4.51
    OS
    32-bit Win Server 2003 SP2
    CPU Cores
    1

    Default

    Download the SmartCurve plugin. Draw a curve that compresses the highlights using a couple points. The resulting S-curve is similar to using a gamma/contrast adjustment, but you can more intuitively adjust how much to cut on the black and white ends separately, to balance between having the text jaggy and leaving some paper texture or reflection from the opposite side visible.

    https://www.softpedia.com/get/Multim...artCurve.shtml

    If you get text from the other side of a sheet visible while scanning, place a black paper, a bible or an organizer book behind the sheet to absorb some light.
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	Clipboard01.png 
Views:	17 
Size:	81.6 KB 
ID:	6067  

  4. #4
    Power User jazzman's Avatar
    Join Date
    Aug 2007
    Posts
    520
    OS
    32-bit Win 7 Professional SP1
    CPU Cores
    1

    Default

    IrfanView comes with SmartCurve included

    Click image for larger version. 

Name:	iv_curve.png 
Views:	18 
Size:	16.4 KB 
ID:	6068
    Last edited by jazzman; 09.01.2021 at 01:13 PM.

    currently running 4.56 / 32 bit

  5. #5
    Multiple User Kuki Dent's Avatar
    Join Date
    Jun 2010
    Location
    Germany, Lower Saxony
    Posts
    306
    OS
    64-bit Win 10
    CPU Cores
    4

    Default

    I'd go another way to be absolutely sure to have a plain white background and use the colour replace tool of IrfanPaint.
    This way it is possible to replace each shade of grey colour with plain white. Use the tolerance to adjust the effect and
    a big value for Width (px).
    Win 10/64 Home 20H2 IrfanView 4.57/64
    Hate has caused a lot of problems in this world, but it has not solved one yet. (Maya Angelou)

  6. #6
    IV Beginner
    Join Date
    Sep 2020
    Location
    Czech Republic
    Posts
    69
    OS
    64-bit Win 10
    CPU Cores
    4

    Default

    Brightness, contrast and gamma correction works quite well. You can also make the text truly black.
    IrfanView 4.57 64bit, Windows 10 20H2

  7. #7
    IV Newbie
    Join Date
    Apr 2020
    Posts
    4
    Version
    IrfanView 4.51
    OS
    64-bit Win 10

    Question

    Quote Originally Posted by Kuki Dent View Post
    I'd go another way to be absolutely sure to have a plain white background and use the colour replace tool of IrfanPaint.
    This way it is possible to replace each shade of grey colour with plain white. Use the tolerance to adjust the effect and
    a big value for Width (px).
    That sounds great. But typically there are so many shades of grey, who can one pick them all? A pity there is not a "record macro" facility you can run to do common things like this on images.
    Last edited by boardtc; 11.01.2021 at 02:28 PM.

  8. #8
    IV Newbie
    Join Date
    Apr 2020
    Posts
    4
    Version
    IrfanView 4.51
    OS
    64-bit Win 10

    Default

    Quote Originally Posted by Bhikkhu Pesala View Post
    An easy way is to use Gamma correction and Contrast = Shift+G.

    Click image for larger version. 

Name:	Before.jpg 
Views:	23 
Size:	351.9 KB 
ID:	6062Click image for larger version. 

Name:	After.jpg 
Views:	22 
Size:	320.0 KB 
ID:	6063
    This is really good for getting rid of the not grey colours it seems, thanks, but left lots of different shades of grey
    Last edited by boardtc; 11.01.2021 at 03:15 PM.

  9. #9
    IV Newbie
    Join Date
    Apr 2020
    Posts
    4
    Version
    IrfanView 4.51
    OS
    64-bit Win 10

    Default

    Quote Originally Posted by j7n View Post
    Download the SmartCurve plugin. Draw a curve that compresses the highlights using a couple points. The resulting S-curve is similar to using a gamma/contrast adjustment, but you can more intuitively adjust how much to cut on the black and white ends separately, to balance between having the text jaggy and leaving some paper texture or reflection from the opposite side visible.

    https://www.softpedia.com/get/Multim...artCurve.shtml

    If you get text from the other side of a sheet visible while scanning, place a black paper, a bible or an organizer book behind the sheet to absorb some light.
    I was unable to understand these instructions, is there perhaps a YouTube demo available?

  10. #10
    IV Newbie
    Join Date
    Jun 2018
    Location
    91304
    Posts
    2

    Default

    All the comments here are good and will make the text in images show up much better. I've found that with a combination of Gamma Correction (Image > Color Corrections or Shift G) and Image > Replace Color, I can get somewhat good black text against a white background. It takes a good clean scan to begin with and then good bit of fiddling. In some places the text may not be clear, and I can then copy & paste words or just letters from elsewhere in the article. I've not tried Smart Curve.

    I keep many recipes on a Recipes folder and have found that the easiest cleanest way is to OCR them and save them as word processor files (ie, Word .doc or .docx). With the scanned recipe image open in Irfanview, if necessary clean it up just so the text is clear. Then go to Options > Start OCR. A full page window (that I can't make smaller) opens with the text it recognizes. Drag your mouse over all the text you want and it will pop up in a Notebook type window so you can easily copy & paste it into a .doc file. Then edit it to fix any OCR errors and format it as you see fit. Once you get the hang of it, it's easier and faster. Doc files also print nicer than images.

    An advantage of this is that you can also copy & paste any image into the doc file also.

    If you don't have a Word Processor, Word Pad is part of Windows and is more than capable.

    Good luck.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •