Register Guidelines E-Books Search Today's Posts Mark Forums Read

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

Notices

Reply
 
Thread Tools Search this Thread
Old 01-12-2020, 04:32 PM   #1
handyguy
Connoisseur
handyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to behold
 
handyguy's Avatar
 
Posts: 52
Karma: 11789
Join Date: Dec 2019
Device: PW4
image that overwrites others is not all black, shows ghost of prevous overlapping img

Hi,
Wondering what the most efficient way to repeatedly write images to the same screen area is. After about 10-20 iterations, the character displayed is no longer solid black, but has lighter areas representative of the previous display in that area.
My current technique is to issue a single fbink with -c to clear the display then multiple fbink to display each alternate character sequentially:
Code:
fbink -1 character5.png -g x=700
Writing a blank image to the area prior to the desired character does then display a nice black character, but this seems inefficient:
Code:
fbink -1 blank.png -g x=700
fbink -1 character5.png -g x=700
Is there an optimal/efficient way to write an image to a subset of the screen (without loosing everything else that is not changing) ?
Attached Thumbnails
Click image for larger version

Name:	char1.JPG
Views:	33
Size:	13.8 KB
ID:	176372  

Last edited by handyguy; 01-12-2020 at 05:45 PM.
handyguy is offline   Reply With Quote
Old 01-12-2020, 05:19 PM   #2
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 9,828
Karma: 17500002
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, (PW) & PW2; Kobo H2O & Forma
Make that section *flash* (i.e., -f) white before making your own new content flash.

That's easy for full-screen content (fbink -fc -> fbink -f -i blah.png).

Slightly trickier for regional content.

The standalone clear option (--cls) could probably use a setting to make it regional. It'd be in terms of absolute screen coordinates, though.

In the meantime, you could *probably* finagle a white rectangle out of the new TTF full padding option...

(Otherwise, yeah, feed it your own properly-sized white PNG ^^).

----

The easier, but less pleasing workaround, is to simply make your new content flash on top of whatever was there. It won't necessarily look any better (in fact, it can make certain patterns behave *worse*).

EDIT: If, for some reason, you're batching content, you will NOT want to do that, because flashing is slow. And annoying on small regions. And won't actually flash in some circumstances anyway. So multiple flashes in a short span of time == pain.

Enter the batching mode (-b)! Do everything you need w/ -b, then add an extra flashing refresh (-s) of the appropriate super-region when you're done. See KOReader's crash screen for a real-world example (where the region happens to be full-screen, so I don't need to do anything fancy to compute the englobing region of all preceding regions).

Last edited by NiLuJe; 01-12-2020 at 05:33 PM.
NiLuJe is online now   Reply With Quote
Advert
Old 01-13-2020, 07:34 PM   #3
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 9,828
Karma: 17500002
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, (PW) & PW2; Kobo H2O & Forma
Done .

This plays nicely with fbink_get_last_rect, and it just makes sense, so, thanks .

(That's also a slightly sneaky way of exposing the internal fill_rect function to the API, for the more adventurous people out there who like to draw rectangle-based stuff by hand ).

Also, finally squished an annoying getopt quirk that made optional arguments w/ suboptions extremely wonky, so, proper for-real optional arguments for -s & -k .

Last edited by NiLuJe; 01-13-2020 at 07:37 PM.
NiLuJe is online now   Reply With Quote
Old 01-14-2020, 05:06 PM   #4
handyguy
Connoisseur
handyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to behold
 
handyguy's Avatar
 
Posts: 52
Karma: 11789
Join Date: Dec 2019
Device: PW4
I tried using the flash option, but it did not clear the ghosting. I tried all the dithering options:
Code:
fbink -s top=0,left=0,width=1072,height=600,dither=PASSTHROUGH
I guess I will periodically draw a blank as the solution.

Last edited by handyguy; 01-14-2020 at 07:15 PM.
handyguy is offline   Reply With Quote
Old 01-15-2020, 12:14 AM   #5
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 9,828
Karma: 17500002
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, (PW) & PW2; Kobo H2O & Forma
Dithering wouldn't help with ghosting .

(In fact, a dithering pattern will probably make it worse. Not that that'd be of interest here anyway, since you're doing mostly solid blocks of colors anyway ).

Sidebar: passthrough happens to be "no dithering" (i.e., the default) ^^.
Sidebar²: I have no idea how well the HW dithering is even supposed to work on Kindle. Initial reports when it was enabled in KOReader seemed to hint that it was broke as hell.

----

Curious how/with what you tried flashing updates, though. Because it should (generally) be mildly helpful.

But, nothing beats flashing white then flashing new content to defeat eInk ghosting .

Last edited by NiLuJe; 01-15-2020 at 12:17 AM.
NiLuJe is online now   Reply With Quote
Advert
Old 01-17-2020, 02:17 AM   #6
handyguy
Connoisseur
handyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to behold
 
handyguy's Avatar
 
Posts: 52
Karma: 11789
Join Date: Dec 2019
Device: PW4
I flashed with the previous code shown above. It either made no improvement, or as you pointed out, the display got worse with light and dark stripes.
handyguy is offline   Reply With Quote
Old 01-17-2020, 12:21 PM   #7
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 9,828
Karma: 17500002
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, (PW) & PW2; Kobo H2O & Forma
That previous snippet (and neither do the original ones) does *NOT* flash, hence me asking for more details .
NiLuJe is online now   Reply With Quote
Old 01-17-2020, 12:25 PM   #8
handyguy
Connoisseur
handyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to behold
 
handyguy's Avatar
 
Posts: 52
Karma: 11789
Join Date: Dec 2019
Device: PW4
A '-s' does not flash? That's what I understood from the previous post above.
Also, as I am going for maximum battery/processor efficiency, wondering if there would be any difference between a flash and an extra write of the blank area - maybe this is a moot point.

Last edited by handyguy; 01-17-2020 at 12:30 PM.
handyguy is offline   Reply With Quote
Old 01-17-2020, 12:53 PM   #9
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 9,828
Karma: 17500002
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, (PW) & PW2; Kobo H2O & Forma
Nope, it doesn't (on its own, at least) .

-f, --flash is what makes (pretty much any combination of other things: i.e., --refresh, --image, --truetype, --clear, --cls, ... you get the picture: all the things ;p) flash .

IIRC, it *does* consume slightly more power, but I'm not sure if it'll have a (really) noticeable impact. My gut feeling would be that one flash would drain less power that two non-flashing updates, though, to answer your question.

Also, some waveform modes *might* be less power-hungry. f.g., you can probably make do w/ DU (which is probably what AUTO, the default, will choose on its own anyway).

And, speaking of wfm, A2 can't flash. Enabling flash will make it try to ghost less on most devices, but it won't actually flash. Just mentioning this for context, as A2 has a really niche use-case, so you probably don't want to use it unless you *know* you want to use it .
(And, with FBInk, it probably wouldn't help on the power consumption side of things, as we enforce monochrome for A2 updates, so that's another PxP processing pass tacked on by the driver).

Last edited by NiLuJe; 01-17-2020 at 01:04 PM.
NiLuJe is online now   Reply With Quote
Old 01-18-2020, 01:02 AM   #10
handyguy
Connoisseur
handyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to beholdhandyguy is a marvel to behold
 
handyguy's Avatar
 
Posts: 52
Karma: 11789
Join Date: Dec 2019
Device: PW4
Not sure what I was smoking when i thought -s was a flash. Thanks for the correction; will try it with DU waveform and report back. I guess if i were ocd, I could run a benchmark of 2 displays vs 1+flash, run it a thousand time in a loop, and measure the current drain.

Last edited by handyguy; 01-18-2020 at 12:18 PM.
handyguy is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Aura Kobo Aura image (.img) Sinseman Kobo Reader 39 11-08-2018 12:12 PM
WANTED: Correct image integration via <img> chaot Workshop 9 03-12-2017 06:44 PM
Text Overlapping Image in Nook for PC, Help dvrader Sigil 4 12-18-2012 08:08 AM
Ask for diags & diags_kernel img for k4 black nikoday Kindle Developer's Corner 12 11-26-2012 12:27 AM
[SOLVED] Aligning text inside a <p> and an image <img> vertically (iBooks) AlPe ePub 1 10-20-2012 01:00 PM


All times are GMT -4. The time now is 01:45 PM.


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