Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.0
    • Fix Version/s: 5.0.3
    • Component/s: None
    • Labels:
      None
    • Environment:
      -
    • Salesforce Case Reference:

      Description

      The attached pdf's clarity is not as good as Adobe. The pdf is poor quality to being with. We've tried setting -Dorg.icepdf.core.imageReference=scaled along with 'mipmap' but see no improvement. Patrick suspects that we may need to write a custom ImageReference implementation for this type of file.

        Activity

        Tyler Johnson created issue -
        Tyler Johnson made changes -
        Field Original Value New Value
        Salesforce Case Reference 5007000000T5ZeEAAV
        Patrick Corless made changes -
        Fix Version/s 5.0.2 [ 10972 ]
        Patrick Corless made changes -
        Fix Version/s 5.0.3 [ 11070 ]
        Fix Version/s 5.0.2 [ 10972 ]
        Hide
        Pepijn Van Eeckhoudt added a comment - - edited

        MipMappedImageReference was (I assume) ported from a patch I submitted some time ago to improve image scaling quality. Unfortunately, the ported version does not implement the scaling in a way that actually improves quality. The javadoc even states (incorrectly) that

        The main idea here is that small images are painted at smaller zoom levels which in theory speeds up the image paint time.

        This was in fact not the main purpose. The main purpose was improved rendering quality of downscaled images. The original version derived each lower-res mipmap level from the previous level, scaling by a factor of two each time. The ported version always scales directly from the initial source image. This is potentially slower and defintely results in poorer image quality due to how Java2D implements image scaling.
        See https://today.java.net/pub/a/today/2007/04/03/perils-of-image-getscaledinstance.html for details.

        Show
        Pepijn Van Eeckhoudt added a comment - - edited MipMappedImageReference was (I assume) ported from a patch I submitted some time ago to improve image scaling quality. Unfortunately, the ported version does not implement the scaling in a way that actually improves quality. The javadoc even states (incorrectly) that The main idea here is that small images are painted at smaller zoom levels which in theory speeds up the image paint time. This was in fact not the main purpose. The main purpose was improved rendering quality of downscaled images. The original version derived each lower-res mipmap level from the previous level, scaling by a factor of two each time. The ported version always scales directly from the initial source image. This is potentially slower and defintely results in poorer image quality due to how Java2D implements image scaling. See https://today.java.net/pub/a/today/2007/04/03/perils-of-image-getscaledinstance.html for details.
        Hide
        Patrick Corless added a comment -

        Thanks for checking back in Pepijn, I'll revisit the patch. Thanks for you feedback.

        Show
        Patrick Corless added a comment - Thanks for checking back in Pepijn, I'll revisit the patch. Thanks for you feedback.
        Patrick Corless made changes -
        Comment [ I've updated the mipmap mode to derive each lower-rec mipmap from the previous levels image. Unfortunately there seems to be an issue with some black and white images not scaling correctly. The resultant images become all black after the scale. ]
        Hide
        Patrick Corless added a comment -

        I've revisited the MIP maps implementation and changed the scaling to incremental scale the same image as suggested above. This combine with fixes to the the image proxy should improve the overall image quality of such pdfs.

        Show
        Patrick Corless added a comment - I've revisited the MIP maps implementation and changed the scaling to incremental scale the same image as suggested above. This combine with fixes to the the image proxy should improve the overall image quality of such pdfs.
        Hide
        Patrick Corless added a comment -

        Closing, the images should look better when mipmap scaling is used, awaiting feedback from the client when 5.0.3 is released.

        Show
        Patrick Corless added a comment - Closing, the images should look better when mipmap scaling is used, awaiting feedback from the client when 5.0.3 is released.
        Patrick Corless made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Patrick Corless made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved: