Skip to content Skip to sidebar Skip to footer

PHP Creating watermark text

Reading Time: < 1 minute

How to create text watermark using php?This is describes how to create simple text watermark using php.Tested in many browsers.Uploaded file type is same to final image type.Only you have to call to the function and get output.View demo and download source code.
In the another post is describes how to create simple image watermark using php.But this watermark text is very simply an smiler to it.First you get a font that you want to apply to this(Ex: TIMES.TTF for Time New Roman font).
Everything I’ll describes here simply by commenting.
This is the php function.


  • 0 – text rotation
  • 140 – The x-cordinate.From left-to-right distance.simply like left padding of the image
  • 270 – The y-cordinate. From top-to-bottom distance.simply like top padding of the image


This is the html form.

Upload Image Image :

'; echo 'Image Name- '.$textWithWatermarkName; } else echo '

'.$msg.'

'; ?>

Now see, how to call to this function.

You uploaded file size is ".$fileSize.'MB';
        }
    }
}
?>

Now put this all together.

You uploaded file size is ".$fileSize.'MB';
        }
    }
}
?>
            
Upload Image Image :

'; echo 'Image Name- '.$textWithWatermarkName; } else echo '

'.$msg.'

'; ?>

That’s only.

View Demo

Download PHP Creating watermark text Example (567 KB)