Package toxi.image.util
Class Filter8bit
java.lang.Object
toxi.image.util.Filter8bit
Filter8bit is a collection of non-destructive, threadsafe filters for
grayscale images in Processing PImage format. All filters are implemented as
static methods so no instance is needed.
- Version:
- 0.1
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic int[]
adaptiveThreshold
(int[] pix, int width, int height, int kernelSize, int filterConst) static processing.core.PImage
adaptiveThreshold
(processing.core.PImage img, int ks, int c) Non-destructively applies an adaptive thresholding filter to the passed in image (grayscale only).static int[]
erodePixels
(int[] pixels, int width, int height, boolean isInverted) static processing.core.PImage
erodePixels
(processing.core.PImage img, boolean isInverted) static int[]
stretchLevels
(int[] srcpix, int lolim, int uplim) static processing.core.PImage
stretchLevels
(processing.core.PImage img, int lolim, int uplim) Non-destructively stretches levels of an 8bit grayscale imagestatic int[]
threshold
(int[] pix, int threshold)
-
Constructor Details
-
Filter8bit
public Filter8bit()
-
-
Method Details
-
adaptiveThreshold
public static int[] adaptiveThreshold(int[] pix, int width, int height, int kernelSize, int filterConst) -
adaptiveThreshold
public static processing.core.PImage adaptiveThreshold(processing.core.PImage img, int ks, int c) Non-destructively applies an adaptive thresholding filter to the passed in image (grayscale only). Filter8bit only uses data stored in the blue channel of the image (lowest 8 bit).- Parameters:
img
- image to be filteredks
- kernel sizec
- constant integer value to be subtracted from kernel result- Returns:
- filtered version of the image (with alpha channel set to full opacity)
-
erodePixels
public static int[] erodePixels(int[] pixels, int width, int height, boolean isInverted) - Parameters:
pixels
-width
-height
-isInverted
-- Returns:
- filtered pixel array
-
erodePixels
public static processing.core.PImage erodePixels(processing.core.PImage img, boolean isInverted) - Parameters:
img
-isInverted
-- Returns:
- filtered result as new image
-
stretchLevels
public static int[] stretchLevels(int[] srcpix, int lolim, int uplim) -
stretchLevels
public static processing.core.PImage stretchLevels(processing.core.PImage img, int lolim, int uplim) Non-destructively stretches levels of an 8bit grayscale image- Parameters:
img
- Image to be level stretcheduplim
- The upper limit for the values to be stretched betweenlolim
- The lower limit for the values to be stretched between- Returns:
- filtered version of the image (with alpha channel set to full opacity)
-
threshold
public static int[] threshold(int[] pix, int threshold)
-