Monday, April 21, 2014

IMAGE COMPOSITION 2

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. 

SPINE IMAGES

The real problem that I ran into was to find spine images of books. They were not scanned in most online libraries and I had to take pictures of book spines and store them on the server for using it later. 

Some images are here


 These images were then scaled to their original size and appended.


Monday, April 14, 2014

IMAGE COMPOSITION

The image of the bookshelf that has to be displayed on the Kindle has to be composed of different spine images of books rather than the front covers. Spine images are really hard to get, so I had to take photographs of spines of books that I wanted on the image, scan some books and download some already scanned images from the internet. 

For composing the basic image on the display I used ImageMagick commands in shell scripts running on the server. Spine images of books were collected by photographs and other online resources. The images were first appended to each other. This step assumes that all the spines are off comparable dimensions. So it just puts together all the spine images into a single image. The resolution of the Kindle Paperwhite is 1024X768 and it can display only Grayscale images. So the resolution of the composed image is modified accordingly using the resize command to fit the screen. For the Grayscale conversion, the convert command is used. So, now the composed imaged is altered to display on a single paperwhite 2. 

After the image is composed, the script on the kindle just pulls it up and displays it. When a new book has to be added, the spine image of the book is first loaded on the server and then the script is executed again to include this new image in composing the bigger picture. The new spine images are stored in a particular name format so all the names associated with a particular naming vocabulary is extracted to compose the picture.

This is the basic version of image composition and does not take into picture the size, height and width of books. These are considered as the project advances.