Class ImageRecompressionOptions
- java.lang.Object
-
- com.pdftools.internal.NativeBase
-
- com.pdftools.internal.NativeObject
-
- com.pdftools.optimization.ImageRecompressionOptions
-
public class ImageRecompressionOptions extends NativeObject
The parameters for image recompression
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CompressionAlgorithmSelection
getAlgorithmSelection()
The strategy for image recompression (Getter)double
getCompressionQuality()
The compression quality for lossy image compression algorithms (Getter)boolean
getReduceColorComplexity()
Enable color complexity reduction.void
setAlgorithmSelection(CompressionAlgorithmSelection value)
The strategy for image recompression (Setter)void
setCompressionQuality(double value)
The compression quality for lossy image compression algorithms (Setter)void
setReduceColorComplexity(boolean value)
Enable color complexity reduction.-
Methods inherited from class com.pdftools.internal.NativeObject
equals, hashCode
-
-
-
-
Method Detail
-
getAlgorithmSelection
public CompressionAlgorithmSelection getAlgorithmSelection()
The strategy for image recompression (Getter)
For each image to be recompressed, a specific choice of compression algorithms are tried. The selection of algorithms depends on this strategy, the type of the optimizer profile (e.g.
profiles.Web
), the color space of the image, andgetCompressionQuality()
. The image is recompressed using the algorithm resulting in the smallest output file.Refer to
CompressionAlgorithmSelection
for more information on strategies.Default:
-
profiles.Web
profile:CompressionAlgorithmSelection.BALANCED
-
profiles.Print
profile:CompressionAlgorithmSelection.PRESERVE_QUALITY
-
profiles.Archive
profile:CompressionAlgorithmSelection.PRESERVE_QUALITY
-
profiles.MinimalFileSize
profile:CompressionAlgorithmSelection.BALANCED
-
profiles.Mrc
profile:CompressionAlgorithmSelection.BALANCED
-
-
setAlgorithmSelection
public void setAlgorithmSelection(CompressionAlgorithmSelection value)
The strategy for image recompression (Setter)
For each image to be recompressed, a specific choice of compression algorithms are tried. The selection of algorithms depends on this strategy, the type of the optimizer profile (e.g.
profiles.Web
), the color space of the image, andgetCompressionQuality()
. The image is recompressed using the algorithm resulting in the smallest output file.Refer to
CompressionAlgorithmSelection
for more information on strategies.Default:
-
profiles.Web
profile:CompressionAlgorithmSelection.BALANCED
-
profiles.Print
profile:CompressionAlgorithmSelection.PRESERVE_QUALITY
-
profiles.Archive
profile:CompressionAlgorithmSelection.PRESERVE_QUALITY
-
profiles.MinimalFileSize
profile:CompressionAlgorithmSelection.BALANCED
-
profiles.Mrc
profile:CompressionAlgorithmSelection.BALANCED
- Throws:
java.lang.IllegalArgumentException
- ifvalue
isnull
-
-
getCompressionQuality
public double getCompressionQuality()
The compression quality for lossy image compression algorithms (Getter)
This property specifies the compression quality for the JPEG and JPEG2000 image compression algorithms. Valid values are between 0 (lowest quality) and 1 (highest quality).
Although the JBIG2 algorithm for bi-tonal images also allows lossy compression, it is not influenced by this property. The JBIG2 compression quality is fixed at 1 (lossless).
Default:
-
profiles.Web
profile: 0.8 -
profiles.Print
profile: 0.9 -
profiles.Archive
profile: 0.9 -
profiles.MinimalFileSize
profile: 0.75 -
profiles.Mrc
profile: 0.75
-
-
setCompressionQuality
public void setCompressionQuality(double value)
The compression quality for lossy image compression algorithms (Setter)
This property specifies the compression quality for the JPEG and JPEG2000 image compression algorithms. Valid values are between 0 (lowest quality) and 1 (highest quality).
Although the JBIG2 algorithm for bi-tonal images also allows lossy compression, it is not influenced by this property. The JBIG2 compression quality is fixed at 1 (lossless).
Default:
-
profiles.Web
profile: 0.8 -
profiles.Print
profile: 0.9 -
profiles.Archive
profile: 0.9 -
profiles.MinimalFileSize
profile: 0.75 -
profiles.Mrc
profile: 0.75
- Throws:
java.lang.IllegalArgumentException
- If the given value is outside of the range 0 - 1
-
-
getReduceColorComplexity
public boolean getReduceColorComplexity()
Enable color complexity reduction. (Getter)
When enabled, the software analyzes images that utilize device color spaces (DeviceRGB, DeviceCMYK, or DeviceGray) as well as indexed images with a device color space as their base. If applicable, the images are converted according to the following criteria:- Images in DeviceRGB or DeviceCMYK color space where all pixels are gray will be converted to grayscale using the DeviceGray color space.
- Images containing only black and white pixels will be converted to bitonal images.
- Images where all pixels are of the same color will be downsampled to a single pixel.
- Soft masks consisting only of black and white pixels will be converted into a standard mask.
- Any (soft) mask that is completely opaque will be removed.
-
profiles.Web
profile:true
-
profiles.Print
profile:true
-
profiles.Archive
profile:true
-
profiles.MinimalFileSize
profile:true
-
profiles.Mrc
profile:false
-
setReduceColorComplexity
public void setReduceColorComplexity(boolean value)
Enable color complexity reduction. (Setter)
When enabled, the software analyzes images that utilize device color spaces (DeviceRGB, DeviceCMYK, or DeviceGray) as well as indexed images with a device color space as their base. If applicable, the images are converted according to the following criteria:- Images in DeviceRGB or DeviceCMYK color space where all pixels are gray will be converted to grayscale using the DeviceGray color space.
- Images containing only black and white pixels will be converted to bitonal images.
- Images where all pixels are of the same color will be downsampled to a single pixel.
- Soft masks consisting only of black and white pixels will be converted into a standard mask.
- Any (soft) mask that is completely opaque will be removed.
-
profiles.Web
profile:true
-
profiles.Print
profile:true
-
profiles.Archive
profile:true
-
profiles.MinimalFileSize
profile:true
-
profiles.Mrc
profile:false
-
-