Watermarking Primer Tutorial

Watermarking Primer Tutorial

Watermarking Primer Tutorial

Watermarking is a process more and more content owners are becoming interested in. For us, on thinking about this topic, we immediately thought about PHP’s GD image library. So we typed into the address bar php gd watermark which, in turn, got us onto an excellent start to our PHP coding from this excellent link, thanks.

We wrote a supervisory PHP web application using an HTML form method=GET so that its dual purpose goes like …

  • if there are no ? and/or & URL arguments existant, the web application shows an HTML form asking for …
    1. image filename or URL
    2. watermark opacity from 0 to 100
    3. watermark wording of a top line
    4. watermark wording of a bottom line

    … that if the user clicks the submit button for …

  • if there are ? and/or & URL arguments existant via the HTML form navigation, we …
    1. perform the PHP GD library processing calls, resulting in …
    2. creation of a PNG image on the web server … used (and self destructed) via (PHP code) …

      header('Content-Type: image/png');
      echo file_get_contents($imwillbe);
      unlink($imwillbe);
      exit;

      … allowing for …
    3. web page that results will have a web browser right click (Windows) or two finger gesture (Mac OS X) option to Save Image As (or something similar) to save your work with the watermark included

Our first draft of watermark.php can be tried, by you, at this live run link.

If this was interesting you may be interested in this too.

This entry was posted in eLearning, Tutorials and tagged , , , , , , , , . Bookmark the permalink.

One Response to Watermarking Primer Tutorial

Leave a Reply

Your email address will not be published. Required fields are marked *