code: public function generate($width, $height)
      {
          $sparkline = imagecreatetruecolor($width, $height);
          imagealphablending($sparkline, false);
          imagecopyresampled(
              $sparkline,
              $this->resource,
              0,
              0,
              0,
              0,
              $width,
              $height,
              $this->width,
              $this->height
          );
          imagesavealpha($sparkline, true);
          imagedestroy($this->resource);
  
          return $sparkline;
      }
docs: @param $width
  @param $height
  
  @return resource