Class ImageFilters

java.lang.Object
dev.avelar.mapnik.ImageFilters

public final class ImageFilters extends Object
Builds the text for Image.filter(String...), the same syntax as the image-filters style attribute. Filters run in the order given: Image.filter(ImageFilters.blur(), ImageFilters.gray()).
  • Method Details

    • blur

      public static String blur()
    • stackBlur

      public static String stackBlur(int radiusX, int radiusY)
      A smoother blur; radii are in pixels.
    • sharpen

      public static String sharpen()
    • emboss

      public static String emboss()
    • edgeDetect

      public static String edgeDetect()
    • sobel

      public static String sobel()
    • xGradient

      public static String xGradient()
    • yGradient

      public static String yGradient()
    • gray

      public static String gray()
      Greyscale.
    • invert

      public static String invert()
      Invert the colours, keeping alpha.
    • colorBlindProtanope

      public static String colorBlindProtanope()
    • colorBlindDeuteranope

      public static String colorBlindDeuteranope()
    • colorBlindTritanope

      public static String colorBlindTritanope()
    • colorToAlpha

      public static String colorToAlpha(String color)
      Make this colour transparent. Accepts any colour string.
    • colorToAlpha

      public static String colorToAlpha(Color color)
    • scaleHsla

      public static String scaleHsla(double h0, double h1, double s0, double s1, double l0, double l1, double a0, double a1)
      Shift hue, saturation, lightness and alpha. Each pair is the range the channel is mapped to, from 0 to 1, for example scaleHsla(0, 1, 0, 0.5, 0, 1, 0, 1) halves the saturation.