Class ColorQuantizer.ColorReductionInfo

java.lang.Object
org.carrot2.util.ColorQuantizer.ColorReductionInfo
Enclosing class:
ColorQuantizer

public static class ColorQuantizer.ColorReductionInfo extends Object
Indicates how many distinct colors an image has, whether it has partial transparency (alpha channel).
  • Field Details

    • distinctColors

      public int distinctColors
      Number of distinct colors in the image.
    • hasPartialTransparency

      public boolean hasPartialTransparency
      True if the image has partially transparent areas (alpha channel).
  • Constructor Details

    • ColorReductionInfo

      public ColorReductionInfo(boolean hasPartialTransparency, int distinctColors)
      Instantiates a new color reduction info.
      Parameters:
      hasPartialTransparency - the has partial transparency
      distinctColors - the distinct colors
  • Method Details

    • canReduceWithoutQualityLoss

      public boolean canReduceWithoutQualityLoss()
      Returns true if the image can be saved in a 8-bit indexed color format with 1-bit transparency without quality loss.
      Returns:
      true, if successful