Random Image with Link - good for "did you know" type of banner which point people to new areas of a website (at least that's why I made it...) **** This uses $level from my
code for the link level determiner ****
A simple function to avoid having to specify image height and width when putting an image in a web page. Specifying these parameters helps the browser display pages faster.
When accessed via the tag: Where $barcode is the string with your information to be barcoded, it returns a pnd image of the barcode. It creates a barcode39 type barcode.
Takes a hex colour in standard HTML format and returns a three element array in which each element is the decimal R, G, or B value which can then be used, for instance, in GD
funcitons
Class to draw a text message as a PNG graphic. The text message, font, colour, background, size, padding, rotation, and transparency can all be defined via OO interface. Code
below can be called as a URL.
This class allows you to crop an image in a variety of ways. You can crop in an absolute or relative way (to a certain size or by a certain size), both as a pixel number or a
percentage. You can also save or display the cropped image. The cropping can be done in 9 different positions: top left, top, top right, left, centre, right, bottom left,
bottom, or bottom right. Or you can automatically crop based on a threshold limit. The original image can be loaded from the file system or from a string (for example, data
returned from a database.) The script attempts to auto-detect the GD version, so you should be able to use GD 1.6 and on up.
This code radomly selects and image from a directory and with the aid of META refresh rotates images on a page in a slideshow fashion. The code will function fine without the
META refresh enabling a different image to be viewed upon page refresh. The script generates a valid IMG tag including graphic dimensions. Will accept either GIF or JPEG
formats. This code should be compliant for both PHP 3.x and PHP 4.x
ok, well as you may have noticed, imagepstext, and imagettftext do not word wrap. I ended up writing THIS code to combat that, and also to help in ALL my sites. With very
little work it can be changed to do lots of cool things with text. This SHOULD work, i dont THINK it is an older copy...
Well, I was shifting from GD with GIF to a newer without GIF, but I had one problem. I had to convert about 2000 GIF files into PNG... that was bad. So I did a little code,
that did the work for me. It can easily be rewritten so it also can handle etc. JPEG.
Hotlinking protection support from PHP: This simple script is an easy way to protect your media images or any files for that matter from remote linking which leads to
bandwidth theft.
A helpful collection of image processing routines. Some convert between colour spaces and others process the image. This library makes it really easy to change the hue,
saturation, brightness, and colour of an image, as well as easily create html hx colour strings, or get the rgb value of a pixel, and more! Methods include: getGDVersion(),
getPixelRGB(), colourDistance(), hex2rgb(), rgb2hex(), rgb2hls(), hls2rgb(), rgb2hsv(), hsv2rgb(), greyscale(), threshold(), colourise() (also accessible as 'colorize') Full
details of these methods, and examples of use, can be found in the class comments.
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 program. 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. Because of the nature of the class, masking large images may take some time!
Inspired by the RSA dolphin and a giant Tux also made of coloured source code.
Turn any png, jpg or gif (if supported by your version of GD) into coloured HTML Text.
This PHP class takes a local file as its input and will determine if the file is a BMP, GIF, JPEG or PNG. It will also extract other generic information about the image,
including resolution, height and width (without using the builtin GetImageSize() or any other PHP extensions) as well as other image type specific information.
This is some code I whipped together that creates an imagemap from an image that if you hover your mouse over it, the color you hover over will be displayed in a text box.
This could be useful for working with a color wheel when asking people for color entries in web apps.
This is an extension of the crop canvas class (http://www.zend.com/codex.php?id=1315&single=1) which provides an interactive cropping area for an image. Very easy to use
and implement drag & resizing GUI interface, built using JavaScript. All required files can be found at: http://php.amnuts.com/index.php?do=view&id=12
Code is simple but it works, normal non optimized jpegs will become small and fast loading site friendly jpegs. note: can be used with gd lower than 2.x and images will remain
to be clear and undistorted
My very first programming in PHP - I know the comments are missing, but play around with it.
Data has to be put into arrays, parameters have to be set manually.
Included is a font-smoothing routine etc.
used to generate a transparent or colored pixel. syntax:
<img src="phpixel.php3"> for a transparent pixel
<img src="phpixel.php3?c=ff0000"> for a red pixel
no gd library needed... only pure php
If you have a message board which allows people to post inline images with the IMG tag, you can use this function to run a few checks on the remote image. Simply pass it the
URI to the image, and it checks the file exits; that it is a recognised image format; and that it is smaller than a predeterminted size. This stops mischief-makers linkng your
page to a 4TB file.
Very simple class to use to write text on an image. Supports GIF, PNG, and JPEG. GD must be compiled with php. For the following example, provide your own image please.
Example: ========================= $config=array( "text" => "123456", "text_colors" => "0 0 0", // RGB Seperated by spaces "image_loc" => "coupon.jpg", "image_type"
=> "JPEG", // PNG and GIF Supported // Optional arguments; default is center area on image "x_pos" => "", "y_pos" => "", ); $graphic=new img_add_txt($config);