![]() |
#1 |
Junior Member
![]() Posts: 9
Karma: 10
Join Date: Jul 2019
Device: none
|
![]()
Hi all.
I've looked in the forums and wiki but I can't seem to figure out why that when I reflow text on a PDF that the output is always in B&W. Even when I have checked "Color Rendering" in Koreader settings. I'm using an Android device, Alcatel Tetra. Any advice or help here? Thanks! |
![]() |
![]() |
![]() |
#2 |
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
|
Possibly because k2pdfopt always outputs B&W pixmaps, or we always request B&W pixmaps from it, I haven't checked, but that seems plausible, given the main target device type
![]() EDIT: A quick glance at the examples would hint at the former, so, tough luck ![]() Last edited by NiLuJe; 07-19-2019 at 12:34 PM. |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Junior Member
![]() Posts: 9
Karma: 10
Join Date: Jul 2019
Device: none
|
Is there not a fix for that? I've used the standalone k2pdfopt before and I know for sure that you can reflow the text while still retaining the color.
|
![]() |
![]() |
![]() |
#4 |
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
|
Possibly, but I've lost any and all motivation to work on PDF stuff, because it's a mess that I don't use
![]() (i.e., patches welcome!) |
![]() |
![]() |
![]() |
#5 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,742
Karma: 730681
Join Date: Oct 2014
Location: Antwerp
Device: Kobo Aura H2O
|
I like PDF but I have basically no motivation for reflow I'm afraid.
![]() |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
cosiñeiro
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,398
Karma: 2451781
Join Date: Apr 2014
Device: BQ Cervantes 4
|
Color output is available since v1.15 https://www.willus.com/k2pdfopt/help/color.shtml
A quick look at our repo searching for dst_color: https://github.com/koreader/libk2pdf...ed_q=dst_color |
![]() |
![]() |
![]() |
#7 | |
Junior Member
![]() Posts: 9
Karma: 10
Join Date: Jul 2019
Device: none
|
Quote:
![]() |
|
![]() |
![]() |
![]() |
#8 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,742
Karma: 730681
Join Date: Oct 2014
Location: Antwerp
Device: Kobo Aura H2O
|
Quote:
I suspect the main loss of color is in the main C files. In settings.c k2settings->dst_color should be set to 1 (or rather allow for a Lua interface override like the DPI property), in functions like k2pdfopt_reflow_bmp and friends I imagine a 24-bit bitmap should be used, and then there's a bunch of presumably much easier to get around stuff in koptinterface.lua and pdfdocument.lua. Unfortunately however, if I'm going to sit down for a good few hours to work on something I figure my time would be better spent migrating Android to Clang or to see if I can figure out https://github.com/koreader/koreader-base/pull/762 Especially because I know a lot more about the build system than about K2pdfopt. ![]() |
|
![]() |
![]() |
![]() |
#9 | |
Junior Member
![]() Posts: 9
Karma: 10
Join Date: Jul 2019
Device: none
|
Quote:
![]() |
|
![]() |
![]() |
![]() |
#10 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,742
Karma: 730681
Join Date: Oct 2014
Location: Antwerp
Device: Kobo Aura H2O
|
This stuff was originally written in 2011 for Kindle only.
![]() Anyway, it shouldn't be super complicated. But I just looked at the code and I don't quite see where the color info is lost. Setting all the mupdf.color stuff to true results in a garbled part of the image, setting color to true in k2pdfopt makes it a nice equal black but still lost. Probably some BB conversion somewhere but boy is the call chain complicated. On Android you can easily use https://gitlab.com/axet/android-k2pdfopt much like on PC. Most Android devices are also quite fast. KOReader's secret sauce here is doing only one page at a time instead of the whole document. It also has some definite disadvantages but otherwise the reflowing process might take quite a while on your average ereader — especially a 2011 Kindle. |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Quick Question on the KT 3G | Barbara1955 | Amazon Kindle | 9 | 10-22-2013 11:25 AM |
Quick question | (-_-) | Kindle Developer's Corner | 2 | 10-24-2012 01:00 PM |
Content Quick GC Question | kpfeifle | Amazon Kindle | 2 | 12-27-2010 02:26 PM |
PRS-600 Okay, quick question.... | emonti8384 | Sony Reader | 13 | 11-12-2009 06:18 PM |
Quick Question. | Baz047 | Sony Reader | 10 | 12-09-2008 12:25 PM |