Converting a PDF to greyscale

I am trying to convert a 212 page PDF file from color to greyscale.


I first attempted to Print, turn off print in color, and save as PDF. But that doesn't work, even though a half dozen websites say it should. The resulting PDF is still in color.


Next I tried another to use the Export feature of Preview and apply the Gray Tone Quartz filter. That only converts the first page of the PDF to greyscale. The rest stay color.


I next tried to use the ColorSync Utility, as Apple's KB advises. That also only makes the first page greyscale and the last PDF in color.


Is there some way I can make this happen on the Mac and preserve the text layer.


Things I WILL NOT do:


  1. I will not upload to some website for conversion.
  2. I will not use Acrobat Pro. It's too expensive.

Mac mini, macOS 13.2

Posted on Nov 22, 2023 1:56 PM

Reply
Question marked as Top-ranking reply

Posted on Nov 22, 2023 4:56 PM

Preview is incapable of exporting a truly grayscale PDF using Quartz Gray tone. The result is still RGB even if it does appear gray.


I happen to have Ghostscript 10.02.1 installed (via homebrew) and it does generate a C:0 M:0 Y:0 K:* output pdf. I can verify that using its ink coverage device and a graytone.pdf exported using Quartz Gray Tone.


gs -o - -sDEVICE=inkcov graytone.pdf
Page 1
0.01204  0.03094  0.01216  0.01105 CMYK OK
Page 2
0.02645  0.04471  0.02645  0.02645 CMYK OK
︙
Page 288
0.01875  0.35909  0.01875  0.01875 CMYK OK


Inkcov is reporting the fraction of ink coverage (converted from RGB) for each color channel in the CMYK space.


Same PDF as opened in Preview, but processed by Ghostscript:

gs \
-sDEVICE=pdfwrite \
-sProcessColorModel=DeviceGray \
-sColorConversionStrategy=Gray \
-dOverrideICC \
-o graytone.pdf -f hp15c.pdf


and when I run inkcov on graytone.pdf:


gs -o -  -sDEVICE=inkcov graytone.pdf
Page 1
0.00000  0.00000  0.00000  0.01141 CMYK OK
Page 2
0.00000  0.00000  0.00000  0.02636 CMYK OK
︙
Page 288
0.00000  0.00000  0.00000  0.09498 CMYK OK


With ghostscript, you can see that the CMY channel values are always zero with ink only being measured in the K (black) channel throughout each page of the document.

20 replies
Question marked as Top-ranking reply

Nov 22, 2023 4:56 PM in response to amp68

Preview is incapable of exporting a truly grayscale PDF using Quartz Gray tone. The result is still RGB even if it does appear gray.


I happen to have Ghostscript 10.02.1 installed (via homebrew) and it does generate a C:0 M:0 Y:0 K:* output pdf. I can verify that using its ink coverage device and a graytone.pdf exported using Quartz Gray Tone.


gs -o - -sDEVICE=inkcov graytone.pdf
Page 1
0.01204  0.03094  0.01216  0.01105 CMYK OK
Page 2
0.02645  0.04471  0.02645  0.02645 CMYK OK
︙
Page 288
0.01875  0.35909  0.01875  0.01875 CMYK OK


Inkcov is reporting the fraction of ink coverage (converted from RGB) for each color channel in the CMYK space.


Same PDF as opened in Preview, but processed by Ghostscript:

gs \
-sDEVICE=pdfwrite \
-sProcessColorModel=DeviceGray \
-sColorConversionStrategy=Gray \
-dOverrideICC \
-o graytone.pdf -f hp15c.pdf


and when I run inkcov on graytone.pdf:


gs -o -  -sDEVICE=inkcov graytone.pdf
Page 1
0.00000  0.00000  0.00000  0.01141 CMYK OK
Page 2
0.00000  0.00000  0.00000  0.02636 CMYK OK
︙
Page 288
0.00000  0.00000  0.00000  0.09498 CMYK OK


With ghostscript, you can see that the CMY channel values are always zero with ink only being measured in the K (black) channel throughout each page of the document.

Nov 22, 2023 4:21 PM in response to dialabrain

dialabrain wrote:

Apparently only a few PDF's don't convert correctly. No idea why.

PDF is just horribly complicated. I was able to find one that demonstrated the same problem. It isn't related to the first page. Any page could fail to convert. My guess is that these are deeply embedded images and Apple's filter doesn't affect them. PDFs can embed entire PDFs inside.


I even did a test. I took the page that didn't convert, copied it out as a TIF, then pasted it back it. Then it converted correctly.

Nov 23, 2023 9:58 AM in response to dialabrain

dialabrain wrote:

As it turns out, Affinity Publisher 2 can correctly import the troublesome PDFs as grey scale then export them.

But the OP specifically said they didn't want to use Acrobat Pro because it's too expensive. I don't know the details of the OP's requirements. Do they just want to convert one file? Or is this an ongoing need? A single month of Acrobat Pro would be cheaper than Affinity Publisher.


In some cases, money can make problems go away. But when so few people are willing to spend, eventually, the price and difficulty skyrocket. Everybody loses in the end.

Nov 23, 2023 5:41 AM in response to etresoft

Using ink_cov still shows CMY color channels with non-zero values when exporting a PDF from Preview with the gray tone Quartz filter. But who cares…?


The average user that is not sending PDFs to commercial printers and just wanting apparent grayscale will likely not care about color lurking behind the grayscale from Preview. Commercial printers may expect PDF/X-3 content and that rules out Apple's PDF framework generation capabilities or Quartz filter (even though a ColorSync Quartz filter exists).

Nov 22, 2023 7:24 PM in response to VikingOSX

I think that’s the wrong device. The “inkcov” device reports the fraction of pixels having a given colour. You want the “ink_cov” device instead.


Not that I necessarily trust Ghostscript anyway. PDF is a mess. It just happens to be ubiquitous.


Also, it isn’t well-defined what “gray” even means. Are we talking about a PDF that looks gray or a PDF that print on a CMYK device using only K? Is that even possible? Or does it depend on a real device? I wouldn’t want to try to create a gray with CMYK halftones. But on a laser printer, I might prefer to do that.

Nov 23, 2023 7:31 AM in response to amp68

amp68 wrote:

I'm having the opposite problem with my PDF. It converts only the first page.

I'm sorry. I really thought this would be an easy answer. My biggest worry when I typed out my first reply was that someone else would type faster and get the first reply.


It seems that, more and more, every answer eventually devolves into some "it's complicated" thread like this one. I really wanted to be able to provide a simple, step-by-step reply that I know would work. I had no idea that the very next file I tested wouldn't work.


I guess I should have known. Apple Preview has been a mess for years. Having to be a cynic every day is exhausting. Just once, I wanted to be able to solve a problem. I'm very confident that, ten year ago, it would have worked perfectly. I'm going to try it in a 10.13 VM to test. I know that I have apps that can do all kinds of PDF manipulations. But of course, they don't work on modern versions of macOS. Free apps like Apple Preview, that do 60% of what you need, or free apps like Ghostscript, that do 100%, but require advanced technical skills, have killed the market for many apps, especially for the Mac.


I don't know of any easy answer.

Nov 23, 2023 8:10 AM in response to etresoft

Adobe Acrobat Pro has a Print Production -> Preflight > Convert to Grayscale feature, but who wants that $2nn annual subscription fee or the $5nn cost of the single purchase price for Acrobat Pro 2020.


It would appear that Master PDF Editor (v5.9.70) can only print, but not export, to Grayscale (e.g.), and the current Nitro PDF Pro (v13.3.1) uses the export Apple Quartz Gray Tone filter for Grayscale.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Converting a PDF to greyscale

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.