ICEpdf
  1. ICEpdf
  2. PDF-822

getPageImage() produces images with poorer quality in comparison to earlier version

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: 5.1
    • Fix Version/s: 6.0
    • Component/s: Core/Parsing
    • Labels:
      None
    • Environment:
      Windows 7 x64, Java 7u21

      Description

      I extract page images using this code:
      for (int index = 0, size = doc.getNumberOfPages(); index < size; index++) {
          for(float zoom: new float[]{1f, 1.5f, 2f}) {
              IDocumentPage page = new DocumentPage();
              BufferedImage image = (BufferedImage) doc.getPageImage(index,
                      GraphicsRenderingHints.SCREEN, Page.BOUNDARY_CROPBOX, 0f, zoom);
              try {
                  ByteArrayOutputStream bos = new ByteArrayOutputStream();
                  ImageIO.write(image, "png", bos);
                  page.setNumber(index);
                  page.setZoom(zoom);
                  page.setByteData(bos.toByteArray());
              } catch (IOException e) {
                  throw new IllegalArgumentException("Can't divided document to pictures", e);
              }
              saveImage(page);
          }
      }

      After migrating to IcePDF 5.1.0 image quality became poorer. See attached example and source pdf. Changing properties described here http://www.icesoft.org/wiki/display/PDF/System+Properties doesn't help at all.
      1. example.pdf
        111 kB
        Yury Shulhat
      1. example.png
        133 kB

        Activity

        Hide
        Patrick Corless added a comment -

        Are you running ICEpdf with any system properties?

        Show
        Patrick Corless added a comment - Are you running ICEpdf with any system properties?
        Hide
        Yury Shulhat added a comment -

        Not actually, we don't use any system properties for IcePDF.

        Show
        Yury Shulhat added a comment - Not actually, we don't use any system properties for IcePDF.
        Hide
        Patrick Corless added a comment -

        Try the following system property, -Dorg.icepdf.core.imageReference=smoothScaled
        This will enable image scaling and should yield similar results to version 4.x

        Show
        Patrick Corless added a comment - Try the following system property, -Dorg.icepdf.core.imageReference=smoothScaled This will enable image scaling and should yield similar results to version 4.x
        Hide
        Patrick Corless added a comment -

        User has been given an option to try and tweak the image rendering. In earlier versions we applied the equivalent of smoothScaled. The default behavior in 5.x is not to scale the image which may lead to image that don't look as good at low zoom values, however the memory usage is significantly reduced as a result.

        Show
        Patrick Corless added a comment - User has been given an option to try and tweak the image rendering. In earlier versions we applied the equivalent of smoothScaled. The default behavior in 5.x is not to scale the image which may lead to image that don't look as good at low zoom values, however the memory usage is significantly reduced as a result.

          People

          • Assignee:
            Patrick Corless
            Reporter:
            Yury Shulhat
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: