protected function getRasterFormatFromFile($filename = null)
{
if ($filename === null) {
return null;
}
$im = $this->getImageFromFile($filename);
$this->setImgWidth($im->getimagewidth());
$this->setImgHeight($im->getimageheight());
/* Convert to PBM and extract raster portion */
$im = self::alphaRemove($im);
$im->setFormat('pbm');
return $this->getRasterBlobFromImage($im);
}