View Single Post
Old 09-25-2014, 09:47 AM   #911
markom
Banned
markom ought to be getting tired of karma fortunes by now.markom ought to be getting tired of karma fortunes by now.markom ought to be getting tired of karma fortunes by now.markom ought to be getting tired of karma fortunes by now.markom ought to be getting tired of karma fortunes by now.markom ought to be getting tired of karma fortunes by now.markom ought to be getting tired of karma fortunes by now.markom ought to be getting tired of karma fortunes by now.markom ought to be getting tired of karma fortunes by now.markom ought to be getting tired of karma fortunes by now.markom ought to be getting tired of karma fortunes by now.
 
Posts: 488
Karma: 1080260
Join Date: Sep 2012
Device: sony prs t1 kindle dx ipad
Quote:
Originally Posted by willus View Post
The -idpi 400 is unnecessary if you are using 200 dpi for your device (e.g. -odpi 200) since by default the source file will be rendered at twice the output dpi. Markom beat me to the punch on explaining the -g option, which is exactly what I would have done for your -cmax 3 or 4 issue. BTW, you have to use a negative value for the -cmax argument to force that contrast value (e.g. -cmax -3). Otherwise it just specifies a maximum limit for k2pdfopt, but k2pdfopt might still choose a lower value if it determines it to be "optimum." In your case, k2pdfopt is probably using that maximum limit, so it likely won't change anything.
As for the gamma, I've tried gamma 1.9 and 2 without threshold and contrast commands, and guess what

The background with gamma 1.9 is certainly not as white as it gets but is good enough for me on Kindle DX even in portraite with smaller letters (than original ones on the paper), letters are dark enough for my liking and details and nuances in tables and graphs are better preserved.
If needed we could also use gamma correction in KPV reader to darken letters a bit.
Reading in landscape (2 screens per page) shall yield bigger letters than on paper, more convenient for those small letters in graphs/tables.

Some "crazy" ideas:

Those on (multitasking) M92 if they wanted, could open two pdfs simultaneously, I guess, and read textual parts in pdf with perfectly white background, jumping to the other pdf for better preserved tables and graphs.

Those who don't have multitasking on their e-ink or maybe do have it but would like the best of the two worlds in the very same pdf (i.e. as white background and as dark letters as it gets and the best preserved tables as possible) could simply merge those two pdfs together e.g. pages with the same number placed next to each other, 1,1,2,2...90,90... or one complete pdf behind another and then use goto-page for jumping to the table on twin page (by always adding the number of pages contained in the second pdf to the current page) by making the bookmarks beforehand or just by paginating it in a few seconds e.g. those in second pdf in Arabic numerals and those in first in Roman or not numbered at all.

To get some idea what do the original and optimized pages (using just gamma 1.9) look like here are thumbnails of similar pdf:




So, to summarize it for those who might encounter similar problems with colored backgrounds and graphs/tables, we can adjust such pdfs using k2pdfopt's commands -wt, -g and -cmax (white threshold, gamma and contrast), as alone or in combination with each other.

-cmax <max> Set max contrast increase on source pages. 1.0 keeps
contrast from being adjusted. Use a negative value to
specify a fixed contrast adjustment. Default = 2.0.

-g <gamma> Set gamma value of output bitmaps. A value less than 1.0
makes the page darker and may make the font more readable.
Default is 0.5.

-wt[+] <thresh> Any pixels whiter than <thresh> (0-255) are treated as
"white". Setting this lower can help k2pdfopt better process
some poorly-quality scanned pages or pages with watermarks.
Note that the pixels which are above this threshold value and
therefore are treated as white are not actually changed to
pure white (255) unless the '+' is also included. Otherwise,
this only sets a threshold.
The default value is -1, which tells k2pdfopt to pick the
optimum value. See also -cmax.

Last edited by markom; 09-25-2014 at 10:50 PM.
markom is offline   Reply With Quote