andy's php projects
Script and site usage:
All of the scripts on this site are provided free for non-commercial, personal or non-profit use. If you wish to use any of these in a commercial system, please refer to the payment plan.

Support:
Support for each of the scripts is given, free of charge, on the message board. Each script has its own message board which can be accessed by clicking on the 'project forum' link (beneath the description of each project).

Proudly hosted with Dreamhost

Save $20 when signing up for Dreamhost by using the promo code amnuts20


If you find these scripts useful to you, appreciate the free support, or are just an all round nice person, then why not donate a little dosh to encourage me to continue? Every little helps!

Zend Certified Engineer logo



Image Masking

This is a class allows you to apply a mask to an image much like you could do in PhotoShop, Gimp, or any other such image manipulation programme. The mask is converted to grayscale so it's best to use black/white patterns. If the mask is smaller than the image then the mask can be placed in various positions (top left, left, top right, left, centre, right, bottom left, bottom, bottom right) or the mask can be resized to the dimensions of the image.

Requires GD 2.0.1+

Because of the nature of the class, masking large images may take some time. So it's best used on thumbnails and the like.

class.imagemask.php

The main class file.

13.66kb in size
last modified May 6, 2006 at 9:55pm
8095 views, 8076 downloads

demomask-blob.png

An example mask.

7.35kb in size
last modified May 6, 2006 at 9:55pm
6717 views, 6153 downloads

demomask-frame1.png

An example mask.

19.78kb in size
last modified May 6, 2006 at 9:55pm
6390 views, 5960 downloads

demomask-frame2.png

An example mask.

17.15kb in size
last modified May 6, 2006 at 9:55pm
6411 views, 6378 downloads

test.imagemask.php

A test file.

375b in size
last modified May 6, 2006 at 9:55pm
7813 views, 6662 downloads
list all projects :: this project's forum :: script in action
added Jan 18, 2004 at 7:34am :: updated Jan 18, 2004 at 7:34am :: 5 files :: 38030 views

© Andrew Collington, 2002-2007.