PHP

HOW TO ADD TEXT TO IMAGES IN PHP

OPEN IMAGE $img = imagecreatefromjpeg("IMG.jpg");

OPEN IMAGE & SETTINGS

01

SETTINGS $size = 30; $x = 30; $y = 30; $angle = 0; $color = imagecolorallocate($img, 255, 255, 255); $font = "PATH/FONT.TTF"; $txt = "Hello World";

WRITE TEXT TO IMAGE imagettftext($img, $size, $angle, $x, $y, $color, $font, $txt);   SAVE IMAGE imagejpeg($img, "WRITTEN.jpg");

WRITE TEXT TO IMAGE

02