Stack Exchange Network
Stack Exchange network consists of 183 Q&A communities including Stack Overflow , the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Convert a PDF to greyscale on the command line in FLOSS?
I have a colour PDF file, and I'm going to print it out and then photocopy it in black and white. I'd like to know what it's like in B&W before photocopying it. Is it possible to 'greyscale' a PDF on the command line using free software? I'm using Ubuntu 9.10.
3 Answers 3
ImageMagick can do this.
via this email
- 38 That significantly reduces quality. @goyinux' solution is better. – Johannes Weiss Feb 12, 2013 at 16:41
- 8 Convert will actually rasterize the contents of the pdf. So unless the pdf already encapsulates only raster images (e.g. a scanned document), this approach is a big no-no. – m000 Sep 19, 2014 at 12:24
- 4 Unless you use -density 400 -quality 100 parameters - that works well – burtek Dec 13, 2015 at 20:51
- 2 Really, is there anything ImageMagick can't do? :) – Joshua Grosso Reinstate CMs Aug 18, 2017 at 3:02
- 1 -density 400 -quality 100 creates HUGE files. +1 for @goyinux's solution. – Stanimir Stoyanov Jun 27, 2018 at 10:45
- 2 Agreed, this gives much better results than convert, but sometimes it rotates the pdf which is a bit annoying! – tdc Aug 7, 2012 at 18:08
- 21 Just realised you can disable that with -dAutoRotatePages=/None – tdc Aug 7, 2012 at 18:15
- 2 I just ran this command on a 58MB PDF that was already greyscale (came from a scanner) and the resulting output was 10MB and looked exactly the same. Nice! – Archie Dec 19, 2012 at 2:33
- 1 Works well on Windows, too! Just remove the `\` and put everything on the same line. – ixe013 Aug 19, 2014 at 4:23
- 1 In fact, this fails with this error GPL Ghostscript 9.10: Unable to convert color space to Gray, reverting strategy to LeaveColorUnchanged. – jjmerelo Dec 15, 2015 at 17:56
Here’s a little script which in addition to the grayscale conversion can concatenate multiple input files. To use the script, put the following lines in a file, e.g. "convert2gray.sh"
and make it executable
will produce a single PDF "converted.pdf", which contains all pages from the input files converted to grayscale.
I had to print out mutliple files all in grayscale and found this the easiest way, since you can print out everything after inpection with one command.
- FWIW, pdftk can concatenate PDFs, too. – user1338062 Jun 14, 2018 at 7:07
You must log in to answer this question.
Not the answer you're looking for browse other questions tagged linux ubuntu command-line pdf ..
- The Overflow Blog
- Wondering how sustainable your buildings are? Make your data speak sponsored post
- Meetings are the worst. Let's reduce their blast radius
Hot Network Questions
- Impossibility of trisecting the 60° angle using only a straightedge and compass
- Diagonal Binary Sequence
- Can I shove a creature away from me in a particular direction?
- Why are jurors asked if each element of a crime is proved, rather than the crime as a whole
- Can I create two or three more cutouts in my 6' Load Bearing Knee wall to build a closet System
- Who is the Israeli official that said that Gaza would be reduced to “a city of tents”?
- Source of a Poincaré quote: "Logic sometimes makes monsters..."
- Do larger rockets tend to have a better mass ratio due to the square cube law?
- Why do electrons not remain at higher energy levels?
- Do the military really use GA planes as target practice?
- When was the last direct conflict within Israel's boundaries?
- How to avoid having a higher total effort after delegating tasks to the team
- The slang term for books made of paper
- If any "antenna" can be impedance matched to the source, can any piece of metal be tuned to perform the same as a physically tuned antenna?
- Find all the real money
- What's the deal with Tek Knight's adaptation from "The Boys" comic book series into "Gen V"?
- Confusion about the conservation of momentum of a ball and an angled wall
- What happened to my car
- Adding direction arrows to discrete plot
- When to add 'de' after a noun when describing the noun
- What is the term for the little viewing window with a sliding cover in a castle or convent?
- How to count when bass and treble clefs share notes or chords
- Do Starfleet officers get to go on leave during times of war?
- Can I expense guest amenities for my AirBnB?
Instantly share code, notes, and snippets.
bzxbot / Convert a PDF file to black and white (not grayscale)
- Star 5 You must be signed in to star a gist
- Fork 1 You must be signed in to fork a gist
404 Not found
404 Not found
Convert PDF to black and white
Maximum combined file size: 100MB, up to 50 files Supported types: PDF, DOC, DOCX, ODT, PPT, PPTX (all files will be converted to PDF automatically)
PDF to grayscale (b/w) converter
Free online tool for converting color PDF to black and white (grayscale). Upload PDF document and click convert.