Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Cleaning up gray mess around text?
#1
[Image: gray-mess.jpg]

I've got a whole document that looks like this; the text is faded, and there's this pale gray… CLOUD... around it. Anything I do to try to fade or remove the cloud makes the text worse; the light areas of text are just too close to the color of the cloud. Darkening the text also darkens the cloud for the same reason. There's got to be a way, though, right…?
Reply
#2
Bad picture but give it a try with (use the different sliders for satisfied result):
G'MIC-Qt / Repair / Repair Scanned Document
G'MIC-Qt / Black & White / Multi-Layer Etch

   
Reply
#3
That definitely looks better… Unfortunately, that plug-in does not exist for the Mac.
Reply
#4
Obtaining this:

   

The process:
  • Use Filters > Enhance > Wavelet decompose (max lelvels: 7)
  • Make all decomposition layers invisible, then make then visible one by one from the bottom 
  • You eventually get some kind of smear that covers your text (level 3 here)
       
  • Open the channels list, and drag any of the RGB channels in the list below to copy it(*)
  • Make it visible and apply a threshold to isolate the text
       
  • Right click and Channel to selection
  • Add new layer at top, and fill selection with white
A slightly simpler way is to apply a Gaussian blur instead of finding the appropriate level of wavelet decomposition, but I find it a bit less accurate.

If necessary you can use Curves in the result to add a  bit more contrast without being bothered by the murky background:

   

(*) Warning: this deselects the channel that you dragged, so click on it to re-select it otherwise later changes won't apply to it (for instance painting with white will appear purple if you dragged the Green channel).
Reply
#5
It is a problem with that small text and your sample might not tell the whole story.

You might get something from
(1) colour select the background with an increased threshold value. Not too much or it eats into the text.
(2) bucket fill the selection with white.
(3) selection off and play with brightness and contrast filter.

   

One thing you could try to assist the editing, is scale the image up say 400% do the editing then scale (25%) the image back down to original. That should introduce a bit of anti-aliasing to the text and make it less 'pixelly'
Reply
#6
Duplicate your layer, put the one on top in Grain Merge mode.

   

May be you can duplicate one more time and put the later in Burn mode if you want a thicker font

   

But in the end your sample image is way too small to do any proper try, I mean we don't really see what the result on this tiny thing you gave us, if something seems to work on 1 square millimeter, it might/will not work on an A4 full page...
Reply
#7
(03-07-2023, 11:01 AM)Ofnuts Wrote: Obtaining this:



The process:
  • Use Filters > Enhance > Wavelet decompose (max lelvels: 7)
  • Make all decomposition layers invisible, then make then visible one by one from the bottom 
  • You eventually get some kind of smear that covers your text (level 3 here)

  • Open the channels list, and drag any of the RGB channels in the list below to copy it(*)
  • Make it visible and apply a threshold to isolate the text

  • Right click and Channel to selection
  • Add new layer at top, and fill selection with white
A slightly simpler way is to apply a Gaussian blur instead of finding the appropriate level of wavelet decomposition, but I find it a bit less accurate.

If necessary you can use Curves in the result to add a  bit more contrast without being bothered by the murky background:



(*) Warning: this deselects the channel that you dragged, so click on it to re-select it otherwise later changes won't apply to it (for instance painting with white will appear purple if you dragged the Green channel).

I did the wavelet thing, which appeared to make no visible change to the image. I did what I think you meant by making layers invisible, by unchecking the eyes, which also didn't change anything, and then rechecked them one by one, which ALSO didn't change anything. The wavelet decompose box comes up with "Create a layer group to store the decomposition" pre-checked, and "Add a layer mask to each scales layers" NOT checked… could this be the problem?

(03-07-2023, 11:18 AM)rich2005 Wrote: It is a problem with that small text and your sample might not tell the whole story.

You might get something from
(1) colour select the background with an increased threshold value. Not too much or it eats into the text.
(2) bucket fill the selection with white.
(3) selection off and play with brightness and contrast filter.



One thing you could try to assist the editing, is scale the image up say 400% do the editing then scale (25%) the image back down to original. That should introduce a bit of anti-aliasing to the text and make it less 'pixelly'

I spent a long time with bucket fill and brightness and contrast, and couldn't find a way to affect the gray cloud at all without adversely affecting the text, much less eliminating the cloud. Scaling the image up and down is a good thing to know in general, so thanks for that, but as far as I can tell it didn't change anything in this case.   Sad

(03-07-2023, 04:35 PM)PixLab Wrote: Duplicate your layer, put the one on top in Grain Merge mode.



May be you can duplicate one more time and put the later in Burn mode if you want a thicker font



But in the end your sample image is way too small to do any proper try, I mean we don't really see what the result on this tiny thing you gave us, if something seems to work on 1 square millimeter, it might/will not work on an A4 full page...

I don't appear to have Grain Merge mode…? Is this a Mac vs PC thing, or part of that plug-in that doesn't exist for the Mac?
Reply
#8
(03-09-2023, 01:44 AM)HavingTooMuchFun Wrote: I don't appear to have Grain Merge mode…? Is this a Mac vs PC thing, or part of that plug-in that doesn't exist for the Mac?

Nothing to do with Mac, it's in all GIMP for all platform, it's not an external/third party plug-in
Which version of GIMP do you have? it was already in GIMP as far as I can recall oldest version, even before (LCh modes might be later, but not Grain Merge)

Question: Did you scroll down enough on the list?
GIMP has 38 layer's mode! (+1 specific only for the group, and +1 specific for filters), Grain merge is the 28th in the list

   
Reply
#9
Quote:..I spent a long time with bucket fill and brightness and contrast, and couldn't find a way to affect the gray cloud at all without adversely affecting the text, much less eliminating the cloud. ..

I would say, either you did not make a suitable selection of the background or the sample image is not representative of the full image. With such small text, never going to be wonderful. Another way is not Gimp, sometimes possible to OCR text. However this, scaled / edited / scaled back to size.

   
Reply
#10
I got rid of the 'cloud' just by using contrast

Smile
Reply


Forum Jump: