Ram Dass: Be Here Now – brightened PDF for e-readers

Download brightened version for e-readers (low res 600px pages, I’ll maybe generate higher res sometime later). As far as I know, it’s ok to distribute it, as a dozen other websites already do.

This is a PDF of Ram Dass’ book: Be Here Now. I started reading it and loved it, since it started very, honest according to my experience.

I uploaded it to my ReMarkable e-reader tablet, but it was unreadable because the scan was too dark. This superuser page got me started fixing it with ImageMagick.

My original commands used the JPEG format so if you actually do the below, you’ll likely end up with slightly better quality. If you like, you can share the result with me. :)

mkdir folder1
mkdir folder2
convert -density 600 ram\ dass\ be\ here\ now.pdf  folder1/output-%03d.png

Then, brighten the images.

There’s a problem though: The scanned images, they’re not all the same dimensions, and worse yet, sometimes width is larger than height, and sometimes the other way around.

So what happens is that when converting back to PDF in the next step, ImageMagick decides the rotation of each image on each page based on the width/height ratio of the image. So you end up some pages in portrait orientation and some in landscape. Which sucks. So we -resize all images to roughly the same ballpark size, and then use -extent to enlarge the canvas to make sure all the resulting bitmaps end up at the exact same dimensions.

If we were smarter we could probably avoid resizing altogether and somehow figure out how to make the canvas have the same aspect ratio despite differences in pixel size. Alas, we’re not that smart, and we’re a bit lazy.

It’s good though. So let’s brighten up the … umh, pages:

mogrify  -path folder2 -format png  -fill white   -brightness-contrast 10,60
 -tint 150 -resize 610x630 -extent 610x630 folder1/output-*.png

Finally, convert the images back to PDF and we’re good to go:

convert folder2/output-*.png lighten-ramdass-beherenow.pdf

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.