diff --git a/src/Analyzers/PixelColorAnalyzer.php b/src/Analyzers/PixelColorAnalyzer.php index aa91b00..746e7d0 100644 --- a/src/Analyzers/PixelColorAnalyzer.php +++ b/src/Analyzers/PixelColorAnalyzer.php @@ -36,7 +36,7 @@ protected function colorAt(ColorspaceInterface $colorspace, VipsImage $vipsImage return $this->driver() ->colorProcessor($colorspace) ->nativeToColor(array_map( - fn(int|float $value): int => (int) min($value, 255), + fn(int|float $value): int => (int) max(min($value, 255), 0), $vipsImage->getpoint($x, $y) )); }