Score:0

ImageMagick-6, how to adjust brightness of background only of scanned page, without touching the text

cn flag

I have a pictures of scanned book, jpeg format. All pages have gray backround with some noise, due to grayscale mode used when scan. ImageMagick-6

Image info:
Resolution: 200x200
Colorspace: Gray
Type: Grayscale
Depth: 8-bit
Channel depth: gray: 8-bit
Gamma: 0.454545
Background color: gray(255)
Border color: gray(223)
Matte color: gray(189)
Transparent color: gray(0)
Interlace: None

Does it possible to adjust (increase) brightness of background only, without touching the brightness of text itself? I tried use command convert -brightness-contrast 10x0 page1.jpg out-001.jpg - but this increases the brightness of both background and text. I want to change the brightness of the background only(remove gray background) - without touching the text itself. Is that possible? If that's not possible, is there method to do same in GIMP?

Score:0
um flag

AFAIK:

convert 'INPUT_FILE' -fuzz '20%' -opaque 'YOUR_GREY_COLOUR' -opaque 'YOUR_TARGET_COLOR' 'TARGRT_FILE'

can make this. The trick od that replace input color with -fuzz tolerance to desired target color. I think this is close what you want.

cn flag
It's not clear how to define the existing gray color value, because the color isn't the same everywhere (like noise), I used Gpick to check gray color, the gray shades varies #F0F0F0, #EDEDED, #F1F1F1.. Page [sample](https://postimg.cc/fVZMS9J3)
Jacek Marcin Jaworski avatar
um flag
You don't have exact grey value - you have load image, probe sample value in Krita or Gimp and play with -fuzz option. Believe me: results are suprisingly good and maybe acceptable. The only catch are images - convert can broke them with greater -fuzz precentage.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.