Dynamic DjVu mask reflow - is it possible?

monday2000
2010-10-13
2012-11-08
  • monday2000

    monday2000 - 2010-10-13

    I have an idea about the DjVu mask so to say "reflow".

    Here what I mean:

    The DjVu mask consists of the shapes and every shape has its coordinates on
    the "canvas" (I don't know how exactly to call it). But what would happen if
    I change the mask-canvas sizes (width and length) - and then change
    accordingly every shape coordinate (to make it suit the new mask size)? It
    is possible?

    The question may arise - why might that be needed? The reason is - the E-Ink
    DjVu readers. They mostly have a narrow screen - so some kind of the
    "preliminary DjVu reflow" would be quite useful (to eliminate the need of re-
    encoding this Djvu to a smaller size).

    How possible such option might be? What DjVuLibre API would it require?

     
  • Dr Bill C Riemers

    In theory the code would not be much different than what is used to reflow
    PDF. One complication however, is there is actually no way to tell what type
    of data is in the mask. When you reflow, you'd be assuming it is characters,
    but it could actually be other types of glyphs, drawings, parts of images. Of
    course you'll have interesting artifacts if you try reflowing in colour mode,
    rather than simply displaying the mask layer. If you are dealing with OCR'd
    DjVu, you could just display the OCR text. However, if the OCR quality is low,
    you could still try to use the OCR layer as hints for where to put paragraph
    breaks and such.

     
  • monday2000

    monday2000 - 2010-10-14

    docbill
    Thanks for reply!

    Mostly I'm concerned about whether it is generally possible or not. If it is,
    than - it's great!

    When you reflow, you'd be assuming it is characters, but it could actually
    be other types of glyphs, drawings, parts of images.

    Yes, I understand. Especially this refers to the bitonal images contained in
    the mask. But the reflow might be not fully automatic - rather including the
    human assistance in the complicated cases.

    you could still try to use the OCR layer as hints for where to put paragraph
    breaks and such.

    Nice hint (about OCR), thanks!

    Of course you'll have interesting artifacts if you try reflowing in colour
    mode, rather than simply displaying the mask layer.

    At least, one could easily change the margin size - and even in the fully
    automatic mode. As for some more complicated reflow cases - probably some
    intricative pattern recognition approach might be required (like OCR etc.).

    But all this is yet an idea, so the exact details are yet unclear.

     

Log in to post a comment.