02-01-2021, 06:07 AM | #1 |
Sloshed
Posts: 65
Karma: 2112464
Join Date: Jan 2008
Device: Kobo Forma, Sony PRS-500
|
whiten gray paper in pdf?
I have some scanned papers with text in pdf and paper is kind of yellowed, so is there a way to somehow whiten the paper and perhaps blacken the letters and drawings?
|
02-01-2021, 09:49 AM | #2 |
the rook, bossing Never.
Posts: 12,276
Karma: 89531599
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
|
ImageMagik
Loads of other tools Though for security reasons I open the PDF in The Gimp at a required resolution. Each page is a layer. I then save as/Export as motion png in reverse order so the pages are correct. Then imagemagik can crop, darken text, brighten background, change from RGB to greyscale or 16 shades grey or 1 bit mono by reading mpng file and creating a pdf file. Then the PDF pages turn about x10 faster too. Some PDF readers can do this on the fly, but not the stock one on Kindle or Kobo. |
02-01-2021, 05:33 PM | #3 | |
Wizard
Posts: 2,299
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Quote:
https://github.com/4lex4/scantailor-...es/tag/v1.0.16 What you'll need to do is split your PDF into individual images, then ScanTailor Advanced should be able to do the "unyellowing" and straightening and everything else. I wrote about that last year in: |
|
02-02-2021, 03:18 AM | #4 |
Sloshed
Posts: 65
Karma: 2112464
Join Date: Jan 2008
Device: Kobo Forma, Sony PRS-500
|
OK I'm trying ScanTailor Advanced and I see it has some commands for fixing but can't find something like "unyellowing"
EDIT oh wait, I kind of figured it out, but still working on it. EDIT I downloaded ImageMagik and I can load only one image at the time and it has commands like Transform> Crop, Chop, Flip, Flop... Can this be done in photoshop on all images at once? EDIT ok I solved it. I did it in Photoshop by using this tutorial https://marckean.com/2011/12/18/use-...s-in-a-folder/ Last edited by prom king; 02-02-2021 at 04:33 AM. |
02-02-2021, 12:04 PM | #5 |
the rook, bossing Never.
Posts: 12,276
Karma: 89531599
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
|
ImageMagik can convert ENTIRE book. But security prevent it (normally) using a PDF as source. So step one is open the PDF in The Gimp (or possiblly photoshop). Each page is a layer. Export in reverse order as a motion png, that's a PNG with a frame for each page, an mpng or mng.
ImageMagik will convert that to PDF. or use https://www.mobileread.com/forums/sh...d.php?t=144711 |
02-02-2021, 08:49 PM | #6 | ||
Wizard
Posts: 2,299
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Quote:
You can choose between:
There's a checkbox for "Equalize illumination" which will do what you want. (This "darkens the black" and "whitens the yellow".) If you chose Black & White, you'll be done. If you chose Color/Grayscale, there's another box under "Filling" > Color, where you can choose between:
That makes the background a solid, consistent color. Quote:
(And depending on the PDF, you might create a huge mess on your hands.) It is possible to split PDF pages into individual images though. I wrote about that back in 2019, "Converting pdf to png images" (Post #2). (You'll probably want to use the mogrify command I wrote in that post.) That's how I sometimes split PDFs -> PNGs. Then I can feed those through Scan Tailor Advanced if needed. Last edited by Tex2002ans; 02-02-2021 at 08:57 PM. |
||
02-04-2021, 09:48 AM | #7 |
Fuzzball, the purple cat
Posts: 1,283
Karma: 11087488
Join Date: Jun 2011
Location: California
Device: iPad
|
By default in “copy” mode, k2pdfopt auto-adjusts the contrast of each page and uses a gamma of 0.5 to help darken the text:
k2pdfopt -mode copy infile.pdf -o outfile.pdf Command-line parameters impacting this are: -cmax Adjust contrast -g Adjust gamma -s[-] Turn on [off] sharpening (on by default in -mode copy) |
04-05-2021, 07:59 AM | #8 |
Enthusiast
Posts: 49
Karma: 510
Join Date: Sep 2008
Device: PSR505
|
hi all,
to throw something in here that i use for exactly this purpose. Noteshrink python QT version: https://github.com/clapautius/noteshrink-qt Commandline: https://github.com/mzucker/noteshrink should fit your purpose extremely well. \Pete |
04-07-2021, 09:52 PM | #9 | |
Fuzzball, the purple cat
Posts: 1,283
Karma: 11087488
Join Date: Jun 2011
Location: California
Device: iPad
|
Quote:
|
|
04-08-2021, 03:19 AM | #10 | |
Wizard
Posts: 2,299
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Quote:
|
|
04-08-2021, 12:51 PM | #11 |
Enthusiast
Posts: 49
Karma: 510
Join Date: Sep 2008
Device: PSR505
|
You both are super right !
the article is a fantastic educational paper - actually worth reading just for interest. \Pete |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Dropdown menu text is gray on gray (Linux Mint) | droopy | Calibre | 8 | 08-18-2019 09:15 PM |
gray background when converting from pdf to epub | Spenjoyere1948 | Calibre | 1 | 06-03-2018 07:53 PM |
How to remove gray background of a (vector) PDF file? | hanschinaman | 0 | 03-17-2012 04:18 AM | |
How to remove gray and dark background from a scanned PDF? | thebestjeter | 6 | 09-08-2011 07:48 AM | |
4 bit gray-scale images to PDF: a need software | SalvaG | 0 | 12-08-2009 01:58 PM |