Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > PDF

Notices

Reply
 
Thread Tools Search this Thread
Old 02-01-2021, 06:07 AM   #1
prom king
Sloshed
prom king ought to be getting tired of karma fortunes by now.prom king ought to be getting tired of karma fortunes by now.prom king ought to be getting tired of karma fortunes by now.prom king ought to be getting tired of karma fortunes by now.prom king ought to be getting tired of karma fortunes by now.prom king ought to be getting tired of karma fortunes by now.prom king ought to be getting tired of karma fortunes by now.prom king ought to be getting tired of karma fortunes by now.prom king ought to be getting tired of karma fortunes by now.prom king ought to be getting tired of karma fortunes by now.prom king ought to be getting tired of karma fortunes by now.
 
prom king's Avatar
 
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?
prom king is offline   Reply With Quote
Old 02-01-2021, 09:49 AM   #2
Quoth
the rook, bossing Never.
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
Posts: 11,154
Karma: 85874891
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.
Quoth is offline   Reply With Quote
Old 02-01-2021, 05:33 PM   #3
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by prom king View Post
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?
ScanTailor Advanced is one of the best tools for this:

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:
Tex2002ans is offline   Reply With Quote
Old 02-02-2021, 03:18 AM   #4
prom king
Sloshed
prom king ought to be getting tired of karma fortunes by now.prom king ought to be getting tired of karma fortunes by now.prom king ought to be getting tired of karma fortunes by now.prom king ought to be getting tired of karma fortunes by now.prom king ought to be getting tired of karma fortunes by now.prom king ought to be getting tired of karma fortunes by now.prom king ought to be getting tired of karma fortunes by now.prom king ought to be getting tired of karma fortunes by now.prom king ought to be getting tired of karma fortunes by now.prom king ought to be getting tired of karma fortunes by now.prom king ought to be getting tired of karma fortunes by now.
 
prom king's Avatar
 
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.
prom king is offline   Reply With Quote
Old 02-02-2021, 12:04 PM   #5
Quoth
the rook, bossing Never.
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
Posts: 11,154
Karma: 85874891
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
Quoth is offline   Reply With Quote
Old 02-02-2021, 08:49 PM   #6
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by prom king View Post
OK I'm trying ScanTailor Advanced and I see it has some commands for fixing but can't find something like "unyellowing"
It's found under one of the final steps, 6 "Output" > Mode.

You can choose between:
  • "Black & White"
  • "Color / Grayscale"

There's a checkbox for "Equalize illumination" which will do what you want. (This "darkens the black" and "whitens the yellow".)

Click image for larger version

Name:	ScanTailorAdvanced.-.Output.png
Views:	417
Size:	132.3 KB
ID:	185174

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:
  • Background
  • White

That makes the background a solid, consistent color.

Click image for larger version

Name:	ScanTailorAdvanced.-.Output2.png
Views:	421
Size:	148.6 KB
ID:	185175

Quote:
Originally Posted by prom king View Post
EDIT I downloaded ImageMagik and I can load only one image at the time and it has commands like Transform> Crop, Chop, Flip, Flop...
ImageMagick is an advanced commandline tool.

(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.
Tex2002ans is offline   Reply With Quote
Old 02-04-2021, 09:48 AM   #7
willus
Fuzzball, the purple cat
willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.
 
willus's Avatar
 
Posts: 1,273
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)
willus is offline   Reply With Quote
Old 04-05-2021, 07:59 AM   #8
icq70610
Enthusiast
icq70610 will become famous soon enoughicq70610 will become famous soon enoughicq70610 will become famous soon enoughicq70610 will become famous soon enoughicq70610 will become famous soon enoughicq70610 will become famous soon enough
 
icq70610's Avatar
 
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
icq70610 is offline   Reply With Quote
Old 04-07-2021, 09:52 PM   #9
willus
Fuzzball, the purple cat
willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.
 
willus's Avatar
 
Posts: 1,273
Karma: 11087488
Join Date: Jun 2011
Location: California
Device: iPad
Quote:
Originally Posted by icq70610 View Post
hi all,

Commandline:

https://github.com/mzucker/noteshrink

should fit your purpose extremely well.

\Pete
Cool piece of software. The author did an excellent page on exactly how it works, too--I might have to sneak this functionality into k2pdfopt.
willus is offline   Reply With Quote
Old 04-08-2021, 03:19 AM   #10
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by willus View Post
Cool piece of software. The author did an excellent page on exactly how it works, too--I might have to sneak this functionality into k2pdfopt.
Fantastic article.
Tex2002ans is offline   Reply With Quote
Old 04-08-2021, 12:51 PM   #11
icq70610
Enthusiast
icq70610 will become famous soon enoughicq70610 will become famous soon enoughicq70610 will become famous soon enoughicq70610 will become famous soon enoughicq70610 will become famous soon enoughicq70610 will become famous soon enough
 
icq70610's Avatar
 
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
icq70610 is offline   Reply With Quote
Reply


Forum Jump

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 PDF 0 03-17-2012 04:18 AM
How to remove gray and dark background from a scanned PDF? thebestjeter PDF 6 09-08-2011 07:48 AM
4 bit gray-scale images to PDF: a need software SalvaG PDF 0 12-08-2009 01:58 PM


All times are GMT -4. The time now is 08:36 AM.


MobileRead.com is a privately owned, operated and funded community.