public class BitmapCompressor extends Object implements IImageProcessor
Constructor and Description |
---|
BitmapCompressor(double scaling, double compression)
Creates a new instance of processor.
|
BitmapCompressor(double scaling, IScalingAlgorithm algorithm, double compression)
Creates a new instance of processor.
|
Modifier and Type | Method and Description |
---|---|
com.itextpdf.kernel.pdf.xobject.PdfImageXObject |
processImage(com.itextpdf.kernel.pdf.xobject.PdfImageXObject objectToProcess, OptimizationSession session)
Optimizes a bitmap image: scales it, changes color scheme from CMYK to RGB if necessary and then compressed it as JPEG.
|
public BitmapCompressor(double scaling, double compression)
AverageCalculationAlgorithm
is used for scaling.
scaling
- is a scaling coefficient, must be in range [0., 1.]
compression
- is a compression coefficient, must be in range [0., 1.]
public BitmapCompressor(double scaling, IScalingAlgorithm algorithm, double compression)
scaling
- is a scaling coefficient, must be in range [0., 1.]
algorithm
- is a scaling algorithm
compression
- is a compression coefficient, must be in range [0., 1.]
public com.itextpdf.kernel.pdf.xobject.PdfImageXObject processImage(com.itextpdf.kernel.pdf.xobject.PdfImageXObject objectToProcess, OptimizationSession session) throws IOException
processImage
in interface IImageProcessor
objectToProcess
- is a PdfImageXObject
representing the image
session
- is an auxiliary object used to support share data between stages of optimization process
IOException
- if image cannot be optimized as JPEG
Copyright © 1998–2022 iText Group NV. All rights reserved.