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

        Patrick Corless made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Patrick Corless made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Patrick Corless made changes -
        Field Original Value New Value
        Fix Version/s 5.0 [ 10314 ]
        Patrick Corless created issue -

          People

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

            Dates

            • Created:
              Updated:
              Resolved: