Page 1 of 1

Remove a color from TIFF files

Posted: 2010-07-14T05:15:38-07:00
by Nexus
Hi,
I am producing PDF files from TIFF scans.
I need to batch remove a color from those TIFF's (i have always exatly the same background), let's say it is RGB (240,240,240) that i want to remove from the whole image.
The conversion should be to (255,255,255).

Can ImageMagick do this for me?

The best thing would be to convert to transparency instead than to white (no clue if this is possible at all...), and then take the transparency over to the final PDF.

Any hint is welcome ;)

Thanks for the attention!
Nexus

Re: Remove a color from TIFF files

Posted: 2010-07-14T06:23:55-07:00
by snibgo
General method to change colour (240,240,240) to White:

Code: Select all

convert in.png -fill White -opaque rgb(240,240,240) out1.png
General method to make colour (240,240,240) transparent:

Code: Select all

convert in.png -transparent rgb(240,240,240) out2.png
There is a knack to getting transparency in PDF files, which I forget. A search of this forum should provide the solution.

Re: Remove a color from TIFF files

Posted: 2010-07-15T02:24:34-07:00
by Nexus
Thank you that worked !