![]() |
#1 |
Junior Member
![]() Posts: 6
Karma: 10
Join Date: Feb 2014
Device: Kobo wifi
|
Kobo wifi PNG display
I have just got a Kobo wifi (4-bit display version), rooted it and installed the koboWeather[3] app on it.
Something that I haven't seen anywhere in my research is a better way of displaying images other than using the "/usr/local/Kobo/pickel showpic" method. Even the koboWeather app uses this which causes one fairly major drawback - speed. Converting the pygame surface to a raw image takes very many seconds. By using the ioctl dumper interposer[2] I decoded the relevant ioctl for displaying an image. Then with the aid of one of the libpng example programs[3] I hacked together a program that can read a PNG image and write it to the display without using pickel. With the aid of this program the koboWeather app's convert_to_raw function requires only a single line to write a PNG file Code:
def convert_to_raw(surface): pygame.image.save(surface,"/tmp/img.png"); Code:
call(["rpng-kobo", "/tmp/img.png"]) My program can also display a PNG image which is not full-screen by passing in the x,y coordinates of the top left of the image like this: Code:
rpng-kobo test.png 300 400 I've attached the source code and executable - only tested on an eReader wifi with 4-bit display. [1] https://bitbucket.org/david_weese/kobo-weather-app [2] https://github.com/kobolabs/Kobo-Rea...e/master/poser [3] http://www.libpng.org/pub/png/book/sources.html |
![]() |
![]() |
![]() |
#2 |
Junior Member
![]() Posts: 6
Karma: 10
Join Date: Feb 2014
Device: Kobo wifi
|
I discovered (after posting) that the code didn't work for all image sizes - specifically odd widths. There was some special case code for odd horizontal pixel positions but that only worked for full size images.
The new version fixes the bug and seems to work for all image sizes (odd and even widths) and positions (odd and even horizontal position). It has only been tested on a Wifi eReader with 4-bit display. |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 348
Karma: 209937
Join Date: Jan 2012
Location: Virginia, US
Device: Kobo Wifi, Kobo Glo
|
Nice work! I'll give it a try on my 8-bit Kobo Wifi when I get some time.
|
![]() |
![]() |
![]() |
#4 | |
Junior Member
![]() Posts: 6
Karma: 10
Join Date: Feb 2014
Device: Kobo wifi
|
Quote:
If you do try then this newer version might be better. There is still something funny that seems to happen after a suspend/wake cycle (failure to update but restarting nickel fixes it). I added two more ioctl() calls that the pickel program uses and it seemed to make it a bit better. I have another program that completely blanks the screen but that doesn't help with the task in hand of partial updates. It looks like when a partial update is performed only the pixels that have changed are updated so perhaps it gets confused sometimes about what is already displayed. |
|
![]() |
![]() |
![]() |
#5 |
Junior Member
![]() Posts: 5
Karma: 10
Join Date: Jan 2014
Device: Kobo
|
This is excellent! I can confirm it works on my 8-bit version. I'm planning on writing something that looks like Kevin's app, but pulling data from my personal weather station. It will help to be able to render the individual metrics (temp, humidity, wind, etc) individually.
|
![]() |
![]() |
Advert | |
|
![]() |
#6 | |
Junior Member
![]() Posts: 6
Karma: 10
Join Date: Feb 2014
Device: Kobo wifi
|
Quote:
Did you see my other thread https://www.mobileread.com/forums/sho...d.php?t=235006 where I provided an RSS reader application that made use of this and also included native Python code that could write to the screen directly? This would allow a partial screen update in real-time if you wanted that. |
|
![]() |
![]() |
![]() |
#7 |
Junior Member
![]() Posts: 3
Karma: 10
Join Date: Mar 2016
Location: Erlangen, Germany
Device: Kobo Glo
|
I want to test this program, too. The program returns the error /lib/libpng12.so.0: version 'PNG12_0' not found. It looks as I have a newer libpng12.so.0 on my Kobo Glo. Please help me to re-compile the rpng-kobo program.
|
![]() |
![]() |
![]() |
#8 |
Linux User
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,282
Karma: 6123806
Join Date: Sep 2010
Location: Heidelberg, Germany
Device: none
|
@Kobold001:
I didn't know about this program, my own alternative is here: https://github.com/frostschutz/Kobo/...show/pngshow.c You can find it as a binary in my screensaver/autoshelf and some other mods. Unlike this one it does not support coordinate offsets (yet?) although you can achieve a similar effect using transparency... |
![]() |
![]() |
![]() |
#9 |
Junior Member
![]() Posts: 3
Karma: 10
Join Date: Mar 2016
Location: Erlangen, Germany
Device: Kobo Glo
|
Thanks frostschutz. I found out that those pngshow programs require a greyscale PNG file with 16 colors. Well, the input PNG files I have, have more colors.
I want to download PNG files from the internet with wget and then display them. This will not work with pngshow without an automatic conversion on the Kobo. I didn't find any converter. That's a pity. |
![]() |
![]() |
![]() |
#10 |
BLAM!
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,506
Karma: 26047190
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
|
![]() |
![]() |
![]() |
#11 | |
Linux User
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,282
Karma: 6123806
Join Date: Sep 2010
Location: Heidelberg, Germany
Device: none
|
Quote:
However pngshow is really just a stupid program that draws PNG on screen, it does not do any scaling or whatever, so this should be the main problem when just downloading random images from somewhere. |
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Images display wrong on kindle 3 keyboard wifi | ebina1 | Kindle Developer's Corner | 11 | 11-26-2013 03:32 PM |
PNG Images in ePUB Files not rendered on Kobo | DragonflyKing | ePub | 12 | 10-12-2013 08:28 PM |
Any way to display custom graphics on the Kobo Wifi? | KevinShort | Kobo Developer's Corner | 1 | 10-13-2012 03:57 PM |
Odd; Kobo-purchased book reads fine on Desktop, WiFi and Sony -but not on Kobo Touch. | beautifulsoup | Kobo Reader | 4 | 07-17-2012 09:29 AM |
where to get autorun.xml, icon.png, key.png, lut.bin for PRS-505 | obender | Sony Reader Dev Corner | 2 | 01-25-2009 03:20 PM |