I want to remove all background chunks from bundled DjVu document to get bitonal document (see my previous thread).
I thought it was possible to extract sjbz chunk for each page and then convert to djvu and join. But I met the problem with global shapes database.
I guess, but how to remove the chunks? I don't know. So my way was to extract Sjbz chunks. How do I extract Djbz chunks? Documentation does not talk about it.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I want to remove all background chunks from bundled DjVu document to get bitonal document (see my previous thread).
I thought it was possible to extract sjbz chunk for each page and then convert to djvu and join. But I met the problem with global shapes database.
session log: --------------------------------------------
$ djvuextract doc.djvu Sjbz=bw.bin
file://localhost/..../doc.djvu: (3081 x 2140) version 21
Sjbz=bw.bin --> "bw.bin" (10030 bytes)
$ djvumake test.djvu Sjbz=bw.bin
*** [1-15410] JB2 data requires a shape dictionary.
*** (JB2Image.cpp:647)
*** 'void JB2Dict::JB2Codec::Decode::code_inherited_shape_count(JB2Dict &)'
% djvudump org_v_01.djvu | head -15 # see document structure
FORM:DJVM [6056138]
DIRM [2369] Document directory (bundled, 291 files 264 pages)
FORM:DJVI [16732] {org_0010_0001_0001.djbz}
Djbz [16720] JB2 shared dictionary
FORM:DJVU [11330] {org_0001_0001_0001.djvu}
INFO [10] DjVu 3081x2140, v21, 300 dpi, gamma=2,2
INCL [23] Indirection chunk --> {org_0010_0001_0001.djbz}
Sjbz [10030] JB2 bilevel data
FGbz [16] JB2 colors data
BG44 [601] IW4 data #1, 74 slices, v1.2 (color), 1027x714
BG44 [157] IW4 data #2, 10 slices
BG44 [97] IW4 data #3, 4 slices
BG44 [324] IW4 data #4, 9 slices
FORM:DJVU [17086] {org_0002_0001_0001.djvu}
INFO [10] DjVu 3081x2140, v21, 300 dpi, gamma=2,2
------------------------------
Do I something wrong?
Thanks,
Mykhal
You have to copy the INCL chunks as well.
There are the one indicating where the shared
shape dictionary is to be found.
In fact the only thing you want to do
is removing the BG44 and FG44/FGbz chunks.
- L.
I guess, but how to remove the chunks? I don't know. So my way was to extract Sjbz chunks. How do I extract Djbz chunks? Documentation does not talk about it.