public function pixelate($w, $h = null) { $x = $this->width / $w; $y = $this->height / (null === $h ? $w : $h); $this->resource->scaleImage($x, $y); $this->resource->scaleImage($this->width, $this->height); return $this; }