04-20-2012, 12:15 AM | #106 |
Carpe diem, c'est la vie.
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
We can adjust the original 0-65 table to 6-bit 0-64 by subtracting one from all values > 32, which would give two 32 cutoff values. This would discard a 50% dither pattern from the center of the table, but the result would be much easier pixel value range scaling.
I suggest that we discard the pure 50% checkerboard, and use that as a "special" pattern created with different function. It LOOKS like pure gray because the pixels are too small to see with the naked eye. I have used 50% checkerboard gray in some of my buttons for drop shadows. It makes a nice addition or pure black and white for area fills, when you want to avoid that "looks bad in black and white" problem you can have with full dithering. As I said all along, dithering is for the ANIMATED portions of the display, and the static portions can be full grayscale antialiased text and images. I think that this should be used in this VNC viewer too, with area motion detection for changing moving areas of the display content to dithered, leaving unchanging areas as full grayscale. By the way, on the touch, when I used my palpump demo using real gray byte values 0-255 instead of dithering, I only get 16 shades of gray (truncated values, not rounded, so only value 255 is white). That means the 8-bit colors are for ease of use, but are really still just 16-colors. You need to dither down from 256 to 16 colors to see a good image, so that must be what eips uses to display PNG images. I may need to adapt my dither function for dithering 256 colors down to 16-colors out of necessity for the touch. |
04-20-2012, 12:41 AM | #107 |
Zealot
Posts: 130
Karma: 10000
Join Date: Mar 2012
Device: Kindle 3G, Kindle Touch 3G, iRiver Story HD, Sony Reader
|
Hi,
This is exact what I did in the afternoon. But I replace all values < 4 with 4, and all values > 59 with 59. Sorry I was not more specific. This made everything < 4 brightness completely black, and > 59 brightness completely white. However, I think this is NOT the best result. Because after all black, it is black with 4 intensity. I think a better way is to scale first, so the brightness values goes instead of 0~63 to -3~67. Then use the same dither table. This will make a smooth transition from all black to linear to all white. Schematically, it is like this Code:
A) original / / / / / B) Cutoff (modify the dither table) __ | / / / __| C) Scaling __ / / / / __/ James |
Advert | |
|
04-20-2012, 01:26 AM | #108 | |
Carpe diem, c'est la vie.
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Quote:
It appears that kindle apps that display images must be dithering them from 256 color down to 16 colors when shown on eink, so we need to do the same, and I can adapt my "geekmaster formula 42" to support this. It is just a matter of time, and there is never enough of that. EDIT: I just realized that my formula as published relied on bit 8 being a sign bit, so I had to change 128 to 256 in four places in the formula, and now it works correctly with my range 0-255 8x8 dither table. That will mean no pixel conversion step going from 8-bit gray to dithered black and white. Nice! Last edited by geekmaster; 04-20-2012 at 04:47 AM. |
|
04-20-2012, 02:21 AM | #109 |
Carpe diem, c'est la vie.
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
@jmseight: Thanks for prodding me to package up tcc with all it needs. It is so easy to install that I have it on all my kindles now and it sure makes for a quick develop and test cycle in an SSH session. Nice!
|
04-20-2012, 03:30 AM | #110 |
Carpe diem, c'est la vie.
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
UPDATE: A "-1" was added to the formula so that the pure blacks and whites are now balanced in a color table display for the K3 also. The previous version had less blacks and more whites on 4-bit displays. All better now.
Here is a nice 8x8 dithered set pixel function for color values 0-255: PHP Code:
EDIT: I just wrote a program that uses the code above to convert all the pixels already in the framebuffer to dithered black and white. In an SSH session I run the program after turning the kindle on and off to get a fresh screensaver image, then run my framebuffer ditherer program, then use dd to snapshot the framebuffer. Other than a quick flash while it rewrites over gray pixels, I have to look close to see that it acually IS dithered. For most of these images, at arms length they look the same. Nice. I did screenshots of converted images, but LCD displays are normally adjusted for about 2.2 gamma, while the kindles to 1.0 gamma. I need to gamma-correct the 256-color values BEFORE dithering to make them look good on the display. You cannot gamma-correct a 2-color image. So showing gamma 1.0 screenshots does not do these gamma 1.0 images justice -- you REALLY need to view them on the kindle. But anyway, here are a couple of the converted images: Spoiler:
Spoiler:
And here is one that I downloaded, then displayed with "eips", dithered with the dither table shown above, and saved with "dd" (the original was rather washed-out, and small, so I stretched it and reduced the gamma a little before copying it to the kindle): Spoiler:
Enjoy! Last edited by geekmaster; 04-20-2012 at 12:38 PM. |
Advert | |
|
04-20-2012, 11:05 AM | #111 |
Carpe diem, c'est la vie.
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Even with my kindle reader font set to its smallest, after dithering the framebuffer, it is still quite readable, and at arm-length you cannot see the difference. It would be a nice option for the PDF reader, and certainly usable for VNC even IF you dither the text. But of course, you really only need to dither the moving parts of the screen.
I have been testing this with a tcc-compiled version of the dither program. I will now cross-compile it to run faster, and then attach it to this post. You can test it from SSH (hint: press up-arrow and enter to repeat), while using the kindle framework to display various menus, images and book pages. UPDATE: The program mentioned above only worked for K4 and newer because it was reading pixel bytes directly from the framebuffer. That does not work for 2bit/pixel kindles like the K3. I now have a "geekmaster formula 69" universal getpx function that returns a pixel value 0-255 from the framebuffer for any x,y coordinate position on any kindle. I am having problems on K3, where I cannot get both solid black and solid white. I am trying to figure out how to stretch and center the range in that formula. Figuring out these formulas needed for branch-free code is a non-trivial task. I will post the framebuffer dithering program with it works on all kindle models. Last edited by geekmaster; 04-20-2012 at 12:47 PM. |
04-20-2012, 12:46 PM | #112 |
Zealot
Posts: 130
Karma: 10000
Join Date: Mar 2012
Device: Kindle 3G, Kindle Touch 3G, iRiver Story HD, Sony Reader
|
Hi,
I tried to download the pictures into my Kindle - looks pretty good. For motion images, I am thinking it would be better to randomize the dither table from frame to frame. That way, the places that are more likely to be black will shift form frame to frame and make a more continuous image. Can you take your code and make it play some video or motion JPEG? Thanks, James |
04-20-2012, 12:50 PM | #113 | |
Carpe diem, c'est la vie.
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Quote:
Ordered dithers are MUCH better for animation on low power devices like this. I plan to port VLC, using the "geekmaster formula 42" dither. Last edited by geekmaster; 04-20-2012 at 12:58 PM. |
|
04-20-2012, 01:20 PM | #114 |
Carpe diem, c'est la vie.
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Here is a "paldemo" 0-255 palette display program that uses the new "geekmaster formula 42" version that balances the number of pure blacks and whites in the palette, for all kindles:
https://www.mobileread.com/forums/sho....php?p=2050759 FYI, the display palette onscreen size is adjustable. In the example, palette(550) is used for a 550x500 pixel palette. EDIT: Be sure to read the text about display gamma in the screenshot spoiler at the above link. This is especially important for converting desktop display images to kindle eink images, like VNC needs to do. I just updated that "display gamma" information, so if you already read it before the "last edited" timestamp on this post, please go back and read it again. Last edited by geekmaster; 04-20-2012 at 02:37 PM. |
04-20-2012, 08:03 PM | #115 |
Carpe diem, c'est la vie.
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Check out my gamma tutorial in the paldemo post of the "geekmaster formula 42" thread (link in my previous post above). I added a screenshot using my new "lcd gamma" dither table. I did gamma compensation by lowering all threshold values with "pow(dt[c], 1/2.2);", which gives a lot more darks and less brights. The palette screenshot looks almost all black on the kindle eink, but about 50% gray average (viewed at a distance) on an lcd display.
I plan to use the "lcd dither table" to make screenshots of dithered screens. Compare the two different gamma screenshots between the lcd and the kindle eink. The top one looks like average 50% gray on the kindle, but the bottom one looks like averat 50% gray on lcd or crt displays. If you do dithering for VNC, we need ANOTHER dither table that uses "pow(dt[c],2.2)", to compensate the other direction. Fun stuff, huh? EDIT: To use pow(), I added "#include <math.h>", and I compiled with "tccmake paldemo2 -lm", to link in the math library. Last edited by geekmaster; 04-20-2012 at 08:07 PM. |
04-21-2012, 11:03 AM | #116 | |
Carpe diem, c'est la vie.
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Quote:
Code:
[root@kindle bin]# ./vlc VLC is not supposed to be run as root. Sorry. If you need to use real-time priorities and/or privileged TCP ports you can use ./vlc-wrapper (make sure it is Set-UID root first and cannot be run by non-trusted users first). [root@kindle bin]# |
|
05-03-2012, 12:46 PM | #117 |
Connoisseur
Posts: 71
Karma: 8068
Join Date: May 2012
Device: PocketBook Inkpad Color 3
|
Hi! First of all thanks a lot four this useful solution. I am a writter and its really great to be able to use an E-ink scree for writting, much better for my eyes.
I almost acomplish to get it right, however i can only see half of the computer's screen in my kindle 3 keyboard as i show in the picture below: Any idea?? Thanks in advance. Last edited by diegoocampo; 05-03-2012 at 12:48 PM. |
05-03-2012, 01:26 PM | #118 |
Wizard
Posts: 1,379
Karma: 2155307
Join Date: Nov 2010
Location: Goettingen, Germany
Device: Kindle Paperwhite, Kobo Mini
|
Well, I think porting rdesktop will get around this :-) To be honest: I don't think there is an ideal solution for Windows 7 yet, except setting your main display to 800x600 resolution. On Linux, we can create a new virtual desktop easily, however I don't know of easy solutions to the problem in Windows. There are various hacks however, like making Windows believe that there is a second (virtual or real) hardware display of size 800x600 and then providing this via VNC. In the mean time, you can just resize your windows.... however, this is probably too flaky in practice.
|
05-03-2012, 02:02 PM | #119 |
Connoisseur
Posts: 71
Karma: 8068
Join Date: May 2012
Device: PocketBook Inkpad Color 3
|
I fixed it! It was nothing, just that i had two monitors connected to my pc and somehow it broke it. With only my laptop plus my kindle 3 connected is working (and yes, i have to resize my desktop to 800x600 but is not a big deal). Also, in windows 7 , with Shit + Alt + Print Screen its quickly switching to high contrast theme which makes everything a little bit more readable.
Is there any way to speed up a little bit the speed the screen syncs with the pc screen?? I mean, i know the e-ink display has low refresh rate, but probably there is a delay due to transmision from pc to kindle. (its still enought speed for my writting purposes though). |
05-03-2012, 03:05 PM | #120 |
hub
Posts: 715
Karma: 2151032
Join Date: Jan 2012
Location: Iranian in Canada
Device: K3G, DXG, Kobo mini
|
|
Tags |
application, kindle, source, viewer, vnc |
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Free (GPLv2) Translation Dictionaries | Elleo | Amazon Kindle | 3 | 01-11-2011 10:57 PM |
Calibre native app on iphone for reading news? | bigreat | Calibre | 2 | 07-21-2010 11:50 PM |
Android Android App: VNC | leo315 | enTourage Archive | 4 | 05-13-2010 06:06 PM |
Android VNC viewer (use your PC from the eDGe!) | devseev | enTourage Archive | 2 | 04-11-2010 01:21 AM |
PalmPDF - native PDF Viewer for Palm OS 5.x | Colin Dunstan | Reading and Management | 2 | 11-23-2005 02:09 PM |