Idea to reduce color number of a scanned image (to grey)

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
Firnustius
Posts: 2
Joined: 2015-10-22T08:56:09-07:00
Authentication code: 1151

Idea to reduce color number of a scanned image (to grey)

Post by Firnustius »

Hi,

I have a lot of scanned picture from comics. The original comic is in black and white anc can be old.
I don't scan myself.

I have some way to reduce image size with -level-colors and -colors and -colorspace . Moving a jpg picture to a png with 8 or 4 grey.

Sometimes : with some hand to find the best value for -level-colors it work good. But sometimes the original file have a lot of glitch. I like to find a way to reduce this glitch.

For example :
Part of original file
Image

mogrify -fuzz 10% -level-colors "#404040","#b0b0b0"
Image

mogrify -adaptive-blur 5 -fuzz 10% -level-colors "#404040","#b0b0b0"
Image

With adaptive-blur it's better, and after i reduce the image size.

But sometimes it's less good, here on the same page:
Image

mogrify -fuzz 10% -level-colors "#404040","#b0b0b0"
Image

mogrify -adaptive-blur 5 -fuzz 10% -level-colors "#404040","#b0b0b0"
Image

I do some test with +dither and -contrast-stretch 0 with directly reduce the file colors and size.

Original:
https://framapic.org/6IgMESPafdWn/hLi9a6GK

convert attualita_supernera-004A-004.jpg +dither -colors 4 -colorspace gray -contrast-stretch 0 -resize 1100 attualita_supernera-004A-004_stre.png
https://framapic.org/6fTEYaw3iomd/M3kqnbWL

convert attualita_supernera-004A-004.jpg -adaptive-blur 5 -fuzz 10% -level-colors "#404040","#b0b0b0" -colors 4 -colorspace gray -resize 1100 attualita_supernera-004A-004_reduceblur.png
https://framapic.org/dVVS8pPymfnr/tKjozY6g

convert attualita_supernera-004A-004.jpg +dither -fuzz 10% -level-colors "#404040","#b0b0b0" -colors 4 -colorspace gray -resize 1100 attualita_supernera-004A-004_reducedither.png
https://framapic.org/Kk6mhoeU7Kik/T6VQZKPs

I think add a blur is the best solution (want to script the process on whole directory), but maybe there are other solution ?

Regards
Firnustius
Posts: 2
Joined: 2015-10-22T08:56:09-07:00
Authentication code: 1151

Re: Idea to reduce color number of a scanned image (to grey)

Post by Firnustius »

OK, with big image using blur at 5 seems OK. Surely must adapt depend on image size

Thanks ;)
Post Reply