ICEpdf
  1. ICEpdf
  2. PDF-540

Update multipage capture example with better interpolation algorithm.

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.0.0 beta1
    • Fix Version/s: 5.0
    • Component/s: Examples
    • Labels:
      None
    • Environment:
      any

      Description

      Update the CCITTFax example to use some very cool interpolation algorithms in JAI to generate a better quality black and white image capture. The image operation is as follow:

        // JAI filter code
              LookupTableJAI lut = new LookupTableJAI(new byte[][]{{(byte) 0x00,
                      (byte) 0xff}, {(byte) 0x00, (byte) 0xff}, {(byte) 0x00, (byte) 0xff}});
              ImageLayout layout = new ImageLayout();
              byte[] map = new byte[]{(byte) 0x00, (byte) 0xff};
              ColorModel cm = new IndexColorModel(1, 2, map, map, map);
              layout.setColorModel(cm);
              SampleModel sm = new MultiPixelPackedSampleModel(DataBuffer.TYPE_BYTE,
                      surrogateImage.getWidth(),
                      surrogateImage.getHeight(),
                      1);
              layout.setSampleModel(sm);
              RenderingHints hints = new RenderingHints(JAI.KEY_IMAGE_LAYOUT, layout);
              PlanarImage op = ErrorDiffusionDescriptor.create(surrogateImage, lut,
                      KernelJAI.ERROR_FILTER_FLOYD_STEINBERG, hints);
              BufferedImage dst = op.getAsBufferedImage();

        Activity

        Hide
        Patrick Corless added a comment -

        Example has been updated with some very nice results. Now that CCITT T.4 is beeing used over the previous "JPEG" tiff compression the resulting image capture size is significantly small. Not very often you get more for less.

        Show
        Patrick Corless added a comment - Example has been updated with some very nice results. Now that CCITT T.4 is beeing used over the previous "JPEG" tiff compression the resulting image capture size is significantly small. Not very often you get more for less.

          People

          • Assignee:
            Patrick Corless
            Reporter:
            Patrick Corless
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: