pixelateFrame($frame); } return $image; } protected function pixelateFrame(FrameInterface $frame): void { $size = $frame->size(); $frame->native()->scaleImage( (int) round(max(1, $size->width() / $this->size)), (int) round(max(1, $size->height() / $this->size)) ); $frame->native()->scaleImage($size->width(), $size->height()); } }