Hello,
I have scanned a children's book with text and colored drawings on the same page.
I have processed the pages with ScanTailor (combined mode), the result is black-white text and the drawings keep their color, it is very good.
But the pages have a big size (5 to 10mb, pages.tif).
Then with GIMP change color RGB to indexed (menu, image, mode, indexed color). This reduces its size to 1 or 2 mb.
my question.
Can I do this with imagemagick? change from RGB to indexed color and thus decrease size.
and can I do it for many pages at once?
Thanks.
--------------------------
Linux openSUSE Tumbleweed KDE.
ImageMagick 7.0.7.11-2.1 (command line)
[SOLVED] Image.tif change RGB to idexed color
[SOLVED] Image.tif change RGB to idexed color
Last edited by absalom on 2017-12-30T00:01:22-07:00, edited 1 time in total.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Image.tif change RGB to idexed color
Code: Select all
convert image.tif -depth 8 -type palette newimag.tif
Code: Select all
convert image.tif -depth 8 -type palette -compress lzw newimag.tif
Re: Image.tif change RGB to idexed color
@fmw42
Yes, it works very well. (But it does not reduce the size as much as gimp. )
¿How can I do it with all the images in a folder (100 files) ?
Thanks.
Yes, it works very well. (But it does not reduce the size as much as gimp. )
¿How can I do it with all the images in a folder (100 files) ?
Thanks.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Image.tif change RGB to idexed color
Use mogrify rather than convert.
Lets say your images are in directory, test1. Create a new directory, test2, to hold the results.
change directories to test1
See http://www.imagemagick.org/Usage/basics/#mogrify
Lets say your images are in directory, test1. Create a new directory, test2, to hold the results.
change directories to test1
Code: Select all
mogrify -format tif -path path2/test2 -depth 8 -type palette -compress lzw *.tif
Re: Image.tif change RGB to idexed color
the script
does not work.
I used
and it worked very well.
thanks for your help.
greetings from Chile
Code: Select all
"path2/test2"
I used
Code: Select all
mogrify -format tif -path test2 -depth 8 -type palette -compress lzw *.tif
thanks for your help.
greetings from Chile
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: [SOLVED] Image.tif change RGB to idexed color
path2/ was just placeholder for your actual path to your new directory