Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle > Kindle Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 12-12-2016, 02:49 AM   #1
kitomer
Member
kitomer began at the beginning.
 
Posts: 16
Karma: 10
Join Date: Dec 2010
Device: Kindle 3 Wi-Fi
Kindle 3 Keyboard: eips BMP support

Hello!

I would like to use the native Kindle command "eips" to draw a bmp to the display (eips -b <filename>). But I struggle to get the bmp displayed correctly. It looks like it is stretched to 3 times its size, so that the actual visual portion is 1/3 of the image. The BMP I tried was a RGB bmp (24bits per pixel) but I also tried a monochrome BMP (8bits per pixel) - same visual error.

Does anyone have information about the specifics of the BMP file that is displayed correctly using eips? Maybe even an example BMP file, that would be very helpful!

Thank You!

Last edited by kitomer; 12-16-2016 at 06:01 AM.
kitomer is offline   Reply With Quote
Old 12-15-2016, 11:41 PM   #2
kitomer
Member
kitomer began at the beginning.
 
Posts: 16
Karma: 10
Join Date: Dec 2010
Device: Kindle 3 Wi-Fi
In case it is of interest to someone here, I will tell you about mit findings regarding the bitmap format when used in combination with the tool "eips" on the kindle 3 keyboard:

The bitmap format usually (simplified) contains a 14 byte header that includes a number that is the offset in bytes from the file start to the start of the pixel data. This header is followed by a 40 byte long information header followed by a color table and an optional gap finally followed by the pixel data bytes.

Since the kindle 3 keyboard has a display capable of displaying 16 distinct gray tones the needed bits per pixel is 4. But when I tried to create a bitmap using ImageMagick (convert bla.jpg -colors 16 output.bmp) it did work _almost_. The resulting image (displayed using eips: eips -b output.bmp) is shown not correctly with the following visual glitches:

- The image is shown upside down

- The colors are weird (the image is recognizable but seems too bright)

- The image is split in vertically in approx. 1/3 and 2/3 halfs which are displayed in the wrong order. This led to the fix I found.

I inspected the bmp from ImageMagick (after a short detour using a buggy version of itself with even more glitches...) and found that the bmp is displayed ONLY if the pixel data bytes start at precisely 312 bytes (for a 4 bits per pixel bitmap with a 16 colors colortable).

Long story short: I did not find a program that would create a bmp which was displayed correctly on the kindele 3 keyboard. I had to create my own program which finally generated the attached file. Feel free to inspect it. If someone is interested in the program that generated this, please ask here, as I have to clean up the code a bit before publishing.

The reason I write this is to share the knowledge but also to ask: WHY is it that "eips" handles the bitmap format in such a broken way? Maybe I missed something.

Also: Anyone with a little time on their hands, maybe they could test the attached bmp on their devices and see how eips displays them? That would be very helpful in order to create more cross platform bmps. IMPORTANT: if you view the attached bmp using some image editor and such, the image is shown upside down (the bmp is interpreted correctly! only the kindle 3 keyboard will display it wrong, which is why the bmp is generated "wrong" in the sense of the bitmap format spec)
Attached Images
File Type: bmp final.bmp (234.7 KB, 179 views)

Last edited by kitomer; 12-15-2016 at 11:43 PM.
kitomer is offline   Reply With Quote
Old 12-15-2016, 11:51 PM   #3
kitomer
Member
kitomer began at the beginning.
 
Posts: 16
Karma: 10
Join Date: Dec 2010
Device: Kindle 3 Wi-Fi
Attached is an image of the final.bmp as it should be displayed on the kindle 3 keyboard for reference. The following details are important: The lines are drawn antialiased and there is a 1 pixel vertical line at the far left stretching from top-left corner to half the image height. Alsothe area occupied by the lines is exactly half the width and height of the display.

On kindles othe than then the kindle 3 keyboard the image may not occupy the whole display, but I am mostly interested in visual artefacts such as distortions and color display.
Attached Thumbnails
Click image for larger version

Name:	final-as-shown-on-kindle.png
Views:	114
Size:	5.0 KB
ID:	153581  
kitomer is offline   Reply With Quote
Old 12-16-2016, 06:03 AM   #4
kitomer
Member
kitomer began at the beginning.
 
Posts: 16
Karma: 10
Join Date: Dec 2010
Device: Kindle 3 Wi-Fi
I found this thread with an example BMP using 8 bits per pixel: https://www.mobileread.com/forums/sho...d.php?t=129623
It seems the eips on Kindle 3 Keyboard understands 8bpp (256 colors) although it can only display 16 colors.

This seems to work as well, though with 4 bits per pixel the filesize is only about half the 8bpp bmp and thus faster to write.
kitomer is offline   Reply With Quote
Old 12-16-2016, 02:56 PM   #5
kitomer
Member
kitomer began at the beginning.
 
Posts: 16
Karma: 10
Join Date: Dec 2010
Device: Kindle 3 Wi-Fi
Unfortunately the 8bpp bmp mentioned in my previous post does not work on the Kindle 3 Keyboard: eips will not render it at all.

This leaves as the only options (at least in my case) the 4bpp fabricated as described above...
kitomer is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Keyboard support in iOS apps tomsem Apple Devices 8 03-04-2016 05:59 PM
Startup logo BMP (tree of characters) robberthof PocketBook 2 04-15-2011 10:38 AM
Android External keyboard support Neptun66 enTourage Archive 2 04-30-2010 02:26 PM
Request USB Keyboard support Nate the great enTourage Archive 1 04-27-2010 07:21 PM
usb keyboard support joblack iRex 1 03-05-2007 11:43 AM


All times are GMT -4. The time now is 08:43 AM.


MobileRead.com is a privately owned, operated and funded community.