Details
-
Type: Bug
-
Status: Closed
-
Priority: 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.
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
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.