public static function textGen(
        $text,
        Drawer $drawer = null,
        $format = 'png',
        $background = 'transparent',
        ImageResourceInterface $resource = null
    ) {
        $imanee = new Imanee(null, $resource);

        if ($drawer !== null) {
            $imanee->setDrawer($drawer);
        }

        $size = $imanee->resource->getTextGeometry($text, $imanee->getDrawer());
        $imanee->newImage($size['width'], $size['height'], $background);
        $imanee->setFormat($format);

        $imanee->placeText($text, Imanee::IM_POS_TOP_LEFT);

        return $imanee;
    }