类 ImageUtility


  • public class ImageUtility
    extends Object
    作者:
    Yun
    • 字段详细资料

    • 方法详细资料

      • imageComparer

        public boolean imageComparer​(File expectedImage,
                                     File actualImage,
                                     File diffImage,
                                     int colorDistance,
                                     int pixelThreshold,
                                     StringBuilder resultMessage)
                              throws Exception
        API: Compare two images and highlight the differ image
        If diffImage is null, will not produce differ image
        If diffImage is not null, the differ image with RED highlight
        "colorDistance", it means that the distance(difference) of two color can be acceptable. if set 0, then color must be completely same. The value should be greater than or equal 0;
        "pixelThreshold", it means that how many the unmatched pixels can be acceptable. if set 0, only all pixels are same, return TRUE. The value should be greater than or equal 0;
        If dimensions of two images are different, then return FALSE and the differ image is merged by two original images.
        Note: only support image types: GIF, PNG, JPEG, BMP, and WBMP
        抛出:
        Exception