public function pixelate($px) { // Create an image resource. $this->createResource(); imagefilter($this->resource, IMG_FILTER_PIXELATE, $px, true); $this->output = $this->resource; return $this; }