help about white-threshold

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
dark76
Posts: 2
Joined: 2018-08-20T13:13:06-07:00
Authentication code: 1152

help about white-threshold

Post by dark76 »

Hello, sorry for my bad english.
I am using ImageMagick-7.0.8-Q16 on Windows 7 32 bit.

I am a newbie, and probably this is an easy task. I would like to make white the dirty paper scan i did many years ago with old scanner.
Image

Code: Select all

magick convert %1 -selective-blur 0x2+08%% -white-threshold 70%% 2a.jpg
Image

How can i improve the result? I would like that yellow would remain yellow, i tried to play with -white-threshold but changing the values i dont't get much better results. Any idea? I would like to get "uniform colours" if you understand what i mean :) thx!
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: help about white-threshold

Post by fmw42 »

try this:

Code: Select all

convert image.jpg -fuzz 10% -fill white -opaque "rgb(220,200,160)" result.jpg
If on Windows in bat file, then double the % to %%.

Adjust the rgb color to better match the region you want to change to white and/or adjust the fuzz value.

See
https://www.imagemagick.org/Usage/color_basics/#replace
https://www.imagemagick.org/script/comm ... s.php#fuzz
https://www.imagemagick.org/script/comm ... s.php#fill
https://www.imagemagick.org/script/comm ... php#opaque
dark76
Posts: 2
Joined: 2018-08-20T13:13:06-07:00
Authentication code: 1152

Re: help about white-threshold

Post by dark76 »

thx for the help, it works much better. In the end i used this and for the moment i am satisfied :)

Code: Select all

magick convert %1 -modulate 100,200 -selective-blur 0x2+05%% -fuzz 12%% -fill white -opaque "rgb(250,200,140)" %~n1_fuzzblur.jpg
Post Reply