Package com.applitools.utils
Class ImageDeltaCompressor
- java.lang.Object
-
- com.applitools.utils.ImageDeltaCompressor
-
public class ImageDeltaCompressor extends Object
Provides image compression based on delta between consecutive images.
-
-
Constructor Summary
Constructors Constructor Description ImageDeltaCompressor()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static byte[]compressByRawBlocks(BufferedImage target, byte[] targetEncoded, BufferedImage source)Compresses a target image based on a difference from a source image.static byte[]compressByRawBlocks(BufferedImage target, byte[] targetEncoded, BufferedImage source, int blockSize)Compresses a target image based on a difference from a source image.
-
-
-
Method Detail
-
compressByRawBlocks
public static byte[] compressByRawBlocks(BufferedImage target, byte[] targetEncoded, BufferedImage source, int blockSize) throws IOException
Compresses a target image based on a difference from a source image.- Parameters:
target- The image we want to compress. (type is TYPE_4BYTE_ABGR)targetEncoded- The image we want to compress in its png bytes representation.source- The baseline image by which a compression will be performed. (type is TYPE_4BYTE_ABGR)blockSize- How many pixels per block.- Returns:
- The compression result, or the
targetEncodedif the compressed bytes count is greater than the uncompressed bytes count. - Throws:
IOException- If there was a problem reading/writing from/to the streams which are created during the process.
-
compressByRawBlocks
public static byte[] compressByRawBlocks(BufferedImage target, byte[] targetEncoded, BufferedImage source) throws IOException
Compresses a target image based on a difference from a source image.blockSizedefaults to 10.- Parameters:
target- The image we want to compress.targetEncoded- The image we want to compress in its png bytes representation.source- The baseline image by which a compression will be performed.- Returns:
- The compression result.
- Throws:
IOException- If there was a problem reading/writing from/to the streams which are created during the process.
-
-