BlackWhite
extends OnPixelBased
in package
implements
FilterInterface
This filter calculates, for each pixel of an image, whether it is ligher or darker than a threshold.
If the pixel is lighter than the thresold it will be black, otherwise it will be light. The result is an image with only black and white pixels (black pixels for ligher colors, white pixels for darker colors).
Table of Contents
Interfaces
- FilterInterface
- Interface for imagine filters.
Properties
- $callback : callable
- $grayScaleFilter : Grayscale
Methods
- __construct() : mixed
- Initialize this filter.
- apply() : ImageInterface
- Applies scheduled transformation to an ImageInterface instance.
Properties
$callback
protected
callable
$callback
$grayScaleFilter
protected
Grayscale
$grayScaleFilter
Methods
__construct()
Initialize this filter.
public
__construct(int $threshold) : mixed
Parameters
- $threshold : int
-
the dask/light threshold, from 0 (all black) to 255 (all white)
Tags
apply()
Applies scheduled transformation to an ImageInterface instance.
public
apply(ImageInterface $image) : ImageInterface
Parameters
- $image : ImageInterface
Tags
Return values
ImageInterface —returns the processed ImageInterface instance