Class ImageComparisonUtil

java.lang.Object
com.vaadin.testbench.screenshot.ImageComparisonUtil

public class ImageComparisonUtil extends Object
  • Constructor Details

    • ImageComparisonUtil

      public ImageComparisonUtil()
  • Method Details

    • generateImageHash

      public static String generateImageHash(BufferedImage image)
      Generates blocks representing an image by dividing the image up in 16x16 pixel blocks and calculating a mean value of the color in each block.
      Parameters:
      image - the image
      Returns:
      the block representation of the image
    • getNrBlocks

      public static int getNrBlocks(int pixels)
      Returns the number of blocks used for the given number of pixels. All blocks are full size with the (possible) exception of the bottom and right edges.
      Parameters:
      pixels - The number of pixels for the dimension.
      Returns:
      The number of blocks used for that dimension