stalno u pokretu

< IT & tech

05. 09. 2014. image manipulation * linux * ubuntu

How to quickly digitalize a book from command line

If you have a printed book that you want quickly turned into an e-book, you can follow these steps:

1. photograph the book, two pages at a time

Take a camera, go to a bright enough place and take a snapshots of your book, two pages at a time. You can also scan them with a scanner, which will produce a better quality, but photographing may be several times quicker.

2. copy the images from the memory card to a temporary directory

3. check the image orientation

Manually check if the rotation of each image is horizontal (pages oriented left-right as opposed to top-bottom). Fix where needed.

4. install imagemagick

sudo apt-get install imagemagick

5. split the images

convert "*.JPG" -crop 50%x100% +repage "page_%d.JPG"

to split images with sharpening and normalizing (enhancing the contrast) at the same time:

convert "*.JPG" -normalize -unsharp 0x1 -crop 50%x100% +repage "page_%03d.JPG"

%03d part says that the counter will always be three digits long with trailing zeros for those smaller than 100. This is important for the proper page order when creating a pdf. If you have more than 999 pages, just increase the number of digits.

6. create a PDF out of the resulting files

Investigate the created page_xxx.JPG files, and fix the order if needed. For example, if you took a snapshot of the cover, rename the page_000.JPG to page_xyz.JPG, where xyz is a number larger than the number in the filename of the last page.

convert page_*.JPG book.pdf

7. clean up

Check the result and remove any unwanted files (like original images and “page” image files).

Related posts

12. 12. 2014. image manipulation * linux * ubuntu
JPG compression (command line) with jpegoptim

[ reading time: ~ 1 min. ]

04. 08. 2014. linux * ubuntu
After installing Ubuntu 14.04

detailed instructions
[ reading time: ~ 1 min. ]

04. 08. 2014. linux * ubuntu
Setting up SSD for faster use and longer life with Ubuntu 14.04

[ reading time: ~ 1 min. ]

18. 08. 2014. cms * linux * ubuntu * wordpress
Installing Wordpress on Ubuntu 14.04

Setting up the db, wp, server, installing the script, adding plugins, unicode, update, creating child theme, overriding plugin css in the child them style.css
[ reading time: ~ 3 min. ]

Ovaj sajt ne sadrži first party kukije i druge mehanizme za aktivno praćenje poseta/ponašanja (facebook, google analytics, itd...). Na nekim stranicama se nalaze embedovani youtube video klipovi i google mape koji učitavaju svoje kukije.