I'm overlaying text on an image and have a custom background color on the text overlay. Is it possible to add some padding to the overlay itself, so that there is spacing between the sides of the overlay itself and the area where the text starts.
Here's my (PHP) code - sorry, I can't figure out how to format it any better in this editor! The second transformation is the one in question.
<?= cl_image_tag($blogpost->image->cloudinary_id, [
'class' => 'img-responsive',
'transformation' => [
'width' => 1200,
'crop' => 'crop',
'aspect_ratio' => 1.9047619048
'overlay' => 'text:rohnroundedmedium.ttf_80:' . $blogpost->title,
'color' => '#FFFFFF',
'gravity' => 'west',
'x' => '25',
'width' => '600',
'crop' => 'fit',
'background' => '#EBAA21'
I had thought of adding a second overlay with just the background color, but the text is dynamically generated so I'm not sure how I'd size that second overlay properly.
Thanks for any suggestions!
Please sign in to leave a comment.