PHP
  Home arrow PHP arrow Dynamic Watermarking with PHP
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Sun Developer Network 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Mobile Linux 
App Generation ROI 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
PHP

Dynamic Watermarking with PHP
By: Brian Vaughn
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 22
    2005-12-28

    Table of Contents:
  • Dynamic Watermarking with PHP
  • Cast and Crew
  • The Nuts and Bolts
  • Helper Functions
  • A Union of Images
  • Taking a Test Drive

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Dynamic Watermarking with PHP


    (Page 1 of 6 )

    One of the things you can do with PHP's many functions for image handling and manipulation is create an image watermarking class. This will allow you to add a watermark to images, which can be useful for a number of purposes. Keep reading to learn how.
    A downloadable file for this article is available here.

    Introduction

    PHP features a wide array of functions for image handling and manipulation. In today’s article, we are going to use those functions to create an image watermarking class. This class will operate on two images: a source image and a watermark. As an optional third parameter our class will also accept an alpha value – allowing our watermark to contain alpha transparency.

    This should be an enjoyable exercise, but hopefully it will also be one that is very useful. For example, let us imagine a scenario where you are hired to create a searchable inventory system for a stock photography website. Obviously you will need to protect your client’s photographs –- offering full quality images only to paying customers. To do this, you could create multiple copies of each image, or you could simply implement a watermarking script like the one we are about to create. This script could then add a watermark to any unpurchased images, while leaving those that have been purchased unmarked.

    Perhaps you can already think of a situation where you could use this type of script – perhaps not. In either case, developing it will be a good learning excercise. Most important, it will be fun! So let’s get started.


    More PHP Articles
    More By Brian Vaughn


       · i hope you all enjoyed todays programming excercise. perhaps a little less practical...
       · Good and helpful article ... I'm definitely going to be using some of this code in...
       · you are correct! the script isn't really intended to be used as-is in the example...
       · I get no watermark image displayed after using the code you showed on here. I have...
       · if you would like to give me a link to your code i would be glad to check it out....
       · I had the same result and I found this line makes an error in 'image.php' :#---...
       · To Save image on disk :add or replace this line in image.php : imagejpeg(...
       · This is nice, but it is always better to have a solution that works on various...
       · Is there any way to get the script to display the watermarked image if the image is...
       · Its really easy but because Im a bit of a PHP noob it took me 4 hours :-/Just...
     

       

    PHP ARTICLES

    - Working With Different Namespaces in PHP 5
    - User Management Explained: Overview
    - Using Namespaces in PHP 5
    - Database Security: Guarding Against SQL Inje...
    - Building a Modular Exception Class in PHP 5
    - Database and Password Security for Web Appli...
    - Handling MySQL Data Set Failures in PHP 5
    - Building Site Registration for Web Applicati...
    - Intercepting Customized Exceptions in PHP 5
    - Securing Your Web Application Against Attacks
    - Sub Classing Exceptions in PHP 5
    - Authentication for Web Application Security
    - Building a Content Management System with Co...
    - Filters and Login Systems for Web Applicatio...
    - Working with the Email Class in Code Igniter





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
    Stay green...Green IT