Turn PDF into grayscale

Dariusz J. Garbowski thuforuk at yahoo.co.uk
Mon Jun 26 23:08:00 UTC 2006


On 06/26/2006 11:11 PM, Sundar Nagarajan wrote:
> Pupeno wrote:
>> Hello,
>> I have some color PDFs I'd like to turn into grayscale, any ideas how ?
>> I have tried printing to PDF (the pdf itself) and setting it to 
>> grayscale, but the PDF ends up in color anyway.
>> Thank you.
>>
> 
> You can do this quite simply at the command line using the Imagemagick 
> tools. Install imagemagick ('apt-get install imagemagick' should do the 
> trick).
> 
> to convert a file named color.pdf to grayscale and store the output in a 
> file named gray.pdf:
> 
> convert -colorspace GRAY color.pdf gray.pdf
> 
> The only drawback I see is that this always seems to choose a gray 
> colorspace with 256 colors (while the original colorspace may have 
> (e.g.) 64K colors. Maybe someone else can comment whether the GRAY 
> colorspace is always 8-bit.

This is simple: gray colour is made of all three RGB channels having the 
same value. Thus you have:

   R   G   B  shade of gray
   0   0   0  black
   1   1   1  almost black
   2   2   2  almost black
...
127 127 127  gray
128 128 128  a bit lighter gray
...
255 255 255  white

what makes 256 colour space (or "gray space" ;-) This can only improve 
if you have more bits-per-channel. Notice that 24 bit colour jpg is only 
8 bit per channel (3 channels * 8 bit = 24 bit).

Regards,
Dariusz






		
___________________________________________________________ 
Try the all-new Yahoo! Mail. "The New Version is radically easier to use" – The Wall Street Journal 
http://uk.docs.yahoo.com/nowyoucan.html





More information about the kubuntu-users mailing list