The main aim while constructing the bookshelf image was to preserve the actual dimensions of the books. To do this, the height of the book in pixels is calculated. The resolution of the kindle is 1024X768 pixels. The height in this case is 1024 pixels, so the books that have a height higher than that should lay flat as they would in a regular bookshelf.
Worldcat.org had most of the heights of books that I wanted. The book name, file name and the heights were recorded in a csv file and read into variables in a bash script. One thing I noticed is that the size of the kindle screen is way smaller than almost all the books I scanned. So, the point is, what we think as a device that resembles a book, is very much smaller than the actual book.
Now, because of this, all the heights had to be scaled down while still showing the differences in heights among them. The height of the resized images and the file names are stored in a separate csv file. The file is read and if the height in pixels is greater than 1024, the spine image is rotated 90 degrees. Images which are rotated 90 degrees are all stacked up horizontally whereas the remaining spine images are stacked vertically. The Image Magick commands that does this are
convert input +append output (verical)
convert input -append output (horizontal)
Now the two final images are appended together vertically, and are converted to grayscale. They are then split into the number of kindles in the system and sent to them.
Worldcat.org had most of the heights of books that I wanted. The book name, file name and the heights were recorded in a csv file and read into variables in a bash script. One thing I noticed is that the size of the kindle screen is way smaller than almost all the books I scanned. So, the point is, what we think as a device that resembles a book, is very much smaller than the actual book.
Now, because of this, all the heights had to be scaled down while still showing the differences in heights among them. The height of the resized images and the file names are stored in a separate csv file. The file is read and if the height in pixels is greater than 1024, the spine image is rotated 90 degrees. Images which are rotated 90 degrees are all stacked up horizontally whereas the remaining spine images are stacked vertically. The Image Magick commands that does this are
convert input +append output (verical)
convert input -append output (horizontal)
Now the two final images are appended together vertically, and are converted to grayscale. They are then split into the number of kindles in the system and sent to them.
