public abstract class RasterCachedMultipageImage extends RasterCachedImage implements IMultipageImage
The raster multipage image
The following example shows batch conversion before saving (exporting) Tiff images.
String fileName = "10MB_Tif.tif";
String inputFileName = fileName;
String outputFileNameTif = "output.tif";
//The possibility of batch conversion before saving (exporting) Tiff images is implemented.
try(com.aspose.imaging.fileformats.tiff.TiffImage tiffImage = (com.aspose.imaging.fileformats.tiff.TiffImage) com.aspose.imaging.Image.load(inputFileName))
{
// Set batch operation for pages
tiffImage.setPageExportingAction(new PageExportingAction()
{
@Override
public void invoke(int pageIndex, Image page)
{
// Fires garbage collection to avoid unnecessary garbage storage from previous pages
System.gc();
((com.aspose.imaging.RasterImage) page).rotate(90);
}
});
tiffImage.save(outputFileNameTif);
/* Attention! In batch mode all pages will be released in this line!
If you want to further perform operations on the original image, you should reload it from the source to another instance. */
}
| Modifier and Type | Method and Description |
|---|---|
void |
adjustBrightness(int brightness)
Adjust of a
brightness for image. |
void |
adjustContrast(float contrast)
Image contrasting |
void |
adjustGamma(float gamma)
Gamma-correction of an image.
|
void |
adjustGamma(float gammaRed,
float gammaGreen,
float gammaBlue)
Gamma-correction of an image.
|
void |
binarizeBradley(double brightnessDifference)
Binarization of an image using Bradley's adaptive thresholding algorithm using the integral image thresholding
|
void |
binarizeBradley(double brightnessDifference,
int windowSize)
Binarization of an image using Bradley's adaptive thresholding algorithm using the integral image thresholding
|
void |
binarizeFixed(byte threshold)
Binarization of an image with predefined threshold
|
void |
binarizeOtsu()
Binarization of an image with Otsu thresholding
|
void |
cacheData()
Caches the data private.
|
void |
crop(int leftShift,
int rightShift,
int topShift,
int bottomShift)
Crop image with shifts.
|
void |
crop(Rectangle rectangle)
Cropping the image.
|
void |
dither(int ditheringMethod,
int bitsCount,
IColorPalette customPalette)
Performs dithering on the current image.
|
void |
filter(Rectangle rectangle,
FilterOptionsBase options)
Filters the specified rectangle.
|
Color |
getBackgroundColor()
Gets a value for the background color.
|
int |
getBitsPerPixel()
Gets the image bits per pixel count.
|
abstract Image |
getDefaultPage()
Deprecated.
Please use getPages()[index]
|
int |
getHeight()
Gets the image height.
|
float |
getImageOpacity()
Gets opacity of this image.
|
abstract int |
getPageCount()
Gets the page count.
|
PageExportingAction |
getPageExportingAction()
Gets the page exporting action.
|
abstract Image[] |
getPages()
Gets the pages.
|
int |
getWidth()
Gets the image width.
|
XmpPacketWrapper |
getXmpData()
Gets XMP data from frame.
|
void |
grayscale()
Transformation of an image to its grayscale representation
|
boolean |
hasAlpha()
Gets a value indicating whether this instance has alpha.
|
boolean |
hasTransparentColor()
Gets a value indicating whether image has transparent color.
|
boolean |
isCached()
Gets a value indicating whether image data is cached currently.
|
void |
normalizeAngle(boolean resizeProportionally,
Color backgroundColor)
Normalizes the angle.
|
void |
replaceColor(int oldColorArgb,
byte oldColorDiff,
int newColorArgb)
Replaces one color to another with allowed difference and preserves original alpha value to save smooth edges.
|
void |
replaceNonTransparentColors(int newColorArgb)
Replaces all non-transparent colors with new color and preserves original alpha value to save smooth edges.
|
void |
resize(int newWidth,
int newHeight,
ImageResizeSettings settings)
Resizes the image.
|
void |
resize(int newWidth,
int newHeight,
int resizeType)
Resizes the image.
|
void |
resizeHeightProportionally(int newHeight,
int resizeType)
Resizes the width proportionally.
|
void |
resizeWidthProportionally(int newWidth,
int resizeType)
Resizes the width proportionally.
|
void |
rotate(float angle,
boolean resizeProportionally,
Color backgroundColor)
RasterCahcedMultipageImage.Rotate image around the center. |
void |
rotateFlip(int rotateFlipType)
Rotates, flips, or rotates and flips all pages.
|
void |
rotateFlipAll(int rotateFlip)
Deprecated.
Please use rotateFlip instead of this method.
|
void |
setBackgroundColor(Color value)
Sets a value for the background color.
|
void |
setPageExportingAction(PageExportingAction value)
Sets the page exporting action.
|
void |
setXmpData(XmpPacketWrapper value)
Sets XMP data from frame.
|
dither, getArgb32Pixel, getDefaultArgb32Pixels, getDefaultPixels, getDefaultRawData, getDefaultRawData, getHorizontalResolution, getModifyDate, getPixel, getPremultiplyComponents, getRawCustomColorConverter, getRawDataFormat, getRawDataSettings, getRawFallbackIndex, getRawIndexedColorConverter, getRawLineSize, getSkewAngle, getTransparentColor, getUpdateXmpData, getUseRawData, getVerticalResolution, isRawDataAvailable, isUsePalette, loadArgb32Pixels, loadArgb64Pixels, loadCmyk32Pixels, loadCmykPixels, loadPartialArgb32Pixels, loadPartialPixels, loadPixels, loadRawData, loadRawData, normalizeAngle, readArgb32ScanLine, readScanLine, replaceColor, replaceNonTransparentColors, rotate, saveArgb32Pixels, saveCmyk32Pixels, saveCmykPixels, savePixels, saveRawData, setArgb32Pixel, setHorizontalResolution, setPalette, setPixel, setPremultiplyComponents, setRawCustomColorConverter, setRawFallbackIndex, setRawIndexedColorConverter, setResolution, setTransparentColor, setTransparentColor, setUpdateXmpData, setUseRawData, setVerticalResolution, toBitmap, writeArgb32ScanLine, writeScanLinecanLoad, canLoad, canLoad, canLoad, canSave, create, create, create, getBounds, getBufferSizeHint, getContainer, getDefaultOptions, getFileFormat, getFileFormat, getFileFormat, getFittingRectangle, getFittingRectangle, getInterruptMonitor, getOriginalOptions, getPalette, getProgressEventHandler, getProgressEventHandlerInfo, getProportionalHeight, getProportionalWidth, getSize, hasBackgroundColor, isAutoAdjustPalette, load, load, load, load, load, load, resize, resizeHeightProportionally, resizeHeightProportionally, resizeWidthProportionally, resizeWidthProportionally, save, save, save, save, save, save, save, save, setAutoAdjustPalette, setBackgroundColor, setBufferSizeHint, setInterruptMonitor, setPalettegetDataStreamContainer, save, save, saveclose, dispose, getDisposedpublic int getHeight()
Gets the image height.
Value: The image height.getHeight in interface IObjectWithBoundsgetHeight in class Imagepublic int getWidth()
Gets the image width.
Value: The image width.getWidth in interface IObjectWithBoundsgetWidth in class Imagepublic int getBitsPerPixel()
Gets the image bits per pixel count.
Value: The image bits per pixel count.<autogeneratedoc></autogeneratedoc>getBitsPerPixel in class Imagepublic final boolean isCached()
Gets a value indicating whether image data is cached currently.
Value:true if image data is cached; otherwise, false.isCached in class RasterCachedImagepublic abstract int getPageCount()
Gets the page count.
Value: The page count.<autogeneratedoc></autogeneratedoc>getPageCount in interface IMultipageImagepublic abstract Image[] getPages()
Gets the pages.
Value: The pages.<autogeneratedoc></autogeneratedoc>getPages in interface IMultipageImage@Deprecated public abstract Image getDefaultPage()
Gets the default page.
getDefaultPage in interface IMultipageImagepublic boolean hasAlpha()
Gets a value indicating whether this instance has alpha.
Value:true if this instance has alpha; otherwise, false.hasAlpha in class RasterImagepublic boolean hasTransparentColor()
Gets a value indicating whether image has transparent color.
hasTransparentColor in class RasterImagepublic float getImageOpacity()
Gets opacity of this image.
Value: The opacity value between 0.0 (fully transparent) and 1.0 (fully opaque).<autogeneratedoc></autogeneratedoc>getImageOpacity in class RasterImagepublic Color getBackgroundColor()
Gets a value for the background color.
getBackgroundColor in class Imagepublic void setBackgroundColor(Color value)
Sets a value for the background color.
setBackgroundColor in class Imagevalue - a value for the background color.public XmpPacketWrapper getXmpData()
Gets XMP data from frame.
Value: XMP packet data wrappergetXmpData in class RasterImagepublic void setXmpData(XmpPacketWrapper value)
Sets XMP data from frame.
Value: XMP packet data wrappersetXmpData in class RasterImagevalue - XMP data from frame.public PageExportingAction getPageExportingAction()
Gets the page exporting action. Please note that setting this method will automatically release page resources after it is executed. It will be executed just before each page is saved.
Value: The page exporting action.getPageExportingAction in interface IMultipageImagepublic void setPageExportingAction(PageExportingAction value)
Sets the page exporting action. Please note that setting this method will automatically release page resources after it is executed. It will be executed just before each page is saved.
Value: The page exporting action.setPageExportingAction in interface IMultipageImagevalue - the page exporting action.public void adjustBrightness(int brightness)
Adjust of a brightness for image.
adjustBrightness in class RasterCachedImagebrightness - Brightness value.public void adjustContrast(float contrast)
Image contrasting
adjustContrast in class RasterCachedImagecontrast - Contrast value (in range [-100; 100])public void adjustGamma(float gammaRed,
float gammaGreen,
float gammaBlue)
Gamma-correction of an image.
adjustGamma in class RasterCachedImagegammaRed - Gamma for red channel coefficientgammaGreen - Gamma for green channel coefficientgammaBlue - Gamma for blue channel coefficientpublic void adjustGamma(float gamma)
Gamma-correction of an image.
adjustGamma in class RasterCachedImagegamma - Gamma for red, green and blue channels coefficientpublic void binarizeFixed(byte threshold)
Binarization of an image with predefined threshold
binarizeFixed in class RasterCachedImagethreshold - Threshold value. If corresponding gray value of a pixel is greater than threshold, a value of
255 will be assigned to it, 0 otherwise.public void binarizeBradley(double brightnessDifference,
int windowSize)
Binarization of an image using Bradley's adaptive thresholding algorithm using the integral image thresholding
binarizeBradley in class RasterCachedImagebrightnessDifference - The brightness difference between pixel and the average of an s x s window of pixels
centered around this pixel.windowSize - The size of s x s window of pixels centered around this pixelpublic void binarizeBradley(double brightnessDifference)
Binarization of an image using Bradley's adaptive thresholding algorithm using the integral image thresholding
binarizeBradley in class RasterCachedImagebrightnessDifference - The brightness difference between pixel and the average of an s x s window of pixels
centered around this pixel.public void binarizeOtsu()
Binarization of an image with Otsu thresholding
binarizeOtsu in class RasterCachedImagepublic void crop(Rectangle rectangle)
Cropping the image.
crop in class RasterCachedImagerectangle - The rectangle.public void crop(int leftShift,
int rightShift,
int topShift,
int bottomShift)
Crop image with shifts.
crop in class RasterImageleftShift - The left shift.rightShift - The right shift.topShift - The top shift.bottomShift - The bottom shift.com.aspose.ms.System.ArgumentException - Rectangle incorrect. - rectangle
or
Rectangle must be contained in the image bounds. - rectangleImageException - Can't crop image. Frame index: " + frameIndex
or
Can't crop image.public void dither(int ditheringMethod,
int bitsCount,
IColorPalette customPalette)
Performs dithering on the current image.
dither in class RasterCachedImageditheringMethod - The dithering method.bitsCount - The final bits count for dithering.customPalette - The custom palette for dithering.public void grayscale()
Transformation of an image to its grayscale representation
grayscale in class RasterCachedImagepublic void rotate(float angle,
boolean resizeProportionally,
Color backgroundColor)
RasterCahcedMultipageImage.Rotate image around the center.
rotate in class RasterCachedImageangle - The rotate angle in degrees. Positive values will rotate clockwise.resizeProportionally - if set to true you will have your image size changed
according to rotated rectangle (corner points) projections in other
case that leaves dimensions untouched and only
image contents are rotated.backgroundColor - Color of the background.public void rotateFlip(int rotateFlipType)
Rotates, flips, or rotates and flips all pages.
rotateFlip in class RasterCachedImagerotateFlipType - The rotate flip type.RotateFlipType@Deprecated public void rotateFlipAll(int rotateFlip)
Rotates the flip all.
rotateFlip - The rotate flip.public void resize(int newWidth,
int newHeight,
int resizeType)
Resizes the image.
resize in class RasterCachedImagenewWidth - The new width.newHeight - The new height.resizeType - The resize type.public void resize(int newWidth,
int newHeight,
ImageResizeSettings settings)
Resizes the image.
resize in class RasterCachedImagenewWidth - The new width.newHeight - The new height.settings - The resize settings.public void resizeWidthProportionally(int newWidth,
int resizeType)
Resizes the width proportionally.
resizeWidthProportionally in class ImagenewWidth - The new width.resizeType - Type of the resize.public void resizeHeightProportionally(int newHeight,
int resizeType)
Resizes the width proportionally.
resizeHeightProportionally in class ImagenewHeight - The new height.resizeType - Type of the resize.public void replaceColor(int oldColorArgb,
byte oldColorDiff,
int newColorArgb)
Replaces one color to another with allowed difference and preserves original alpha value to save smooth edges.
replaceColor in class RasterImageoldColorArgb - Old color ARGB value to be replaced.oldColorDiff - Allowed difference in old color to be able to widen replaced color tone.newColorArgb - New color ARGB value to replace old color with.public void replaceNonTransparentColors(int newColorArgb)
Replaces all non-transparent colors with new color and preserves original alpha value to save smooth edges. Note: if you use it on images without transparency, all colors will be replaced with a single one.
replaceNonTransparentColors in class RasterImagenewColorArgb - New color ARGB value to replace non transparent colors with.public void filter(Rectangle rectangle, FilterOptionsBase options)
Filters the specified rectangle.
filter in class RasterImagerectangle - The rectangle.options - The options.public void normalizeAngle(boolean resizeProportionally,
Color backgroundColor)
Normalizes the angle.
This method is applicable to scanned text documents to get rid of the skewed scan.
This method uses RasterImage.getSkewAngle() and RasterImage.rotate(float, boolean, Color) methods.
normalizeAngle in class RasterImageresizeProportionally - if set to true you will have your image size changed according to rotated rectangle (corner points) projections in other case that leaves dimensions untouched and only internal image contents are rotated.backgroundColor - Color of the background.public void cacheData()
Caches the data private.
cacheData in class RasterCachedImageCopyright (c) 2008-2022 Aspose Pty Ltd. All Rights Reserved.