Zend - The PHP Company




Graphics

Add Code


A Random Image with Link  

Type: code fragment
Added by: jasendorf
Entered: 30/06/2000
Last modified: 08/12/2006
Rating: **** (5 votes)
Views: 10719
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 ****


Auto specify Image Size  

Type: code fragment
Added by: jsalido
Entered: 08/04/2000
Last modified: 08/12/1999
Rating: **** (11 votes)
Views: 10608
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.


AutoMondrian  

Type: code fragment
Added by: onion2k
Entered: 24/06/2004
Last modified: 07/12/2003
Rating: ***** (3 votes)
Views: 4533
Generate "Mondrian" art randomly.


Barcode creator  

Type: application
Added by: ritt9322
Entered: 25/02/2004
Last modified: 02/12/2003
Rating: - (fewer than 3 votes)
Views: 7307
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.


Change colour format  

Type: code fragment
Added by: robf
Entered: 14/03/2000
Last modified: 08/12/1999
Rating: **** (3 votes)
Views: 6925
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 Text as PNG Graphic  

Type: class
Added by: hermannus
Entered: 25/10/2000
Last modified: 01/12/2000
Rating: - (fewer than 3 votes)
Views: 10561
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.


Client Server Image Communication  

Type: code fragment
Added by: xpc
Entered: 27/01/2003
Last modified: 03/12/2002
Rating: - (fewer than 3 votes)
Views: 5474
JavaScript and PHP server communication via the document.images object in the html DOM.


Crop Canvas  

Type: class
Added by: amnuts
Entered: 03/01/2004
Last modified: 01/12/2003
Rating: - (fewer than 3 votes)
Views: 6023
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.


Display the daily UserFriendly comic strip  

Type: code fragment
Added by: karakas
Entered: 28/11/2002
Last modified: 02/11/2001
Rating: - (fewer than 3 votes)
Views: 5392
This PHP script will display the daily comic from the well-known User Friendly site (www.userfriendly.org).


Dynamic image preview end easy info retrieve.  

Type: class
Added by: buffaloBuff
Entered: 24/01/2002
Last modified: 01/12/2001
Rating: - (fewer than 3 votes)
Views: 7741
Class that utilizes gd library to retrieve image info and preview an image dynamically. Also have a look at the example code


Dynamic Image Rotation  

Type: application
Added by: Jayrox
Entered: 04/06/2001
Last modified: 06/12/2000
Rating: - (fewer than 3 votes)
Views: 7843
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


Embed Flash  

Type: code fragment
Added by: nyquist
Entered: 17/10/2001
Last modified: 01/11/2000
Rating: - (fewer than 3 votes)
Views: 7079
Embed Flash swf's in php using a function call from another php file


full "text on image" function. Center and wrap text.  

Type: code fragment
Added by: phpfarm
Entered: 24/05/2001
Last modified: 05/12/2000
Rating: - (fewer than 3 votes)
Views: 9008
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...


Function to grab an image  

Type: code fragment
Added by: pris
Entered: 10/05/2002
Last modified: 05/12/2001
Rating: - (fewer than 3 votes)
Views: 5739
This function allows you to grab an image from a remote host and write it into a new file in the local host.


GIF to HTML  

Type: code fragment
Added by: itodd
Entered: 27/10/2000
Last modified: 01/12/2000
Rating: ***** (12 votes)
Views: 11858
Creates a html document which resembles a gif file. requires gd.


GIF2PNG  

Type: code fragment
Added by: tcr480
Entered: 08/10/2002
Last modified: 31/10/2001
Rating: - (fewer than 3 votes)
Views: 4420
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.


Graphical Anticounter  

Type: code fragment
Added by: jcostom
Entered: 24/07/2000
Last modified: 08/12/1999
Rating: **** (3 votes)
Views: 6321
A graphical companion to The Anticounter. More silliness.


Hotlinking Image Protection  

Type: code fragment
Added by: xpc
Entered: 14/03/2003
Last modified: 03/12/2002
Rating: - (fewer than 3 votes)
Views: 6125
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.


Image Cache  

Type: class
Added by: bakins
Entered: 19/07/2000
Last modified: 08/12/1999
Rating: **** (4 votes)
Views: 7910
"Cache" dynamically created images.


Image Functions  

Type: class library
Added by: amnuts
Entered: 17/08/2004
Last modified: 08/12/2003
Rating: - (fewer than 3 votes)
Views: 7341
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.


Image Mask  

Type: class
Added by: amnuts
Entered: 19/01/2004
Last modified: 01/12/2003
Rating: - (fewer than 3 votes)
Views: 6438
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!


Image To HTML Text Converter  

Type: class
Added by: easy
Entered: 16/07/2000
Last modified: 08/12/1999
Rating: ***** (14 votes)
Views: 12533
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.


Image to HTML Text Converter Class  

Type: application
Added by: mangled
Entered: 02/06/2001
Last modified: 06/12/2000
Rating: - (fewer than 3 votes)
Views: 5448
Image to HTML Text Converter Class


ImageCrop  

Type: code fragment
Added by: DuckObalaNET
Entered: 06/04/2001
Last modified: 04/12/2000
Rating: - (fewer than 3 votes)
Views: 7208
copy a part of an image to another one and saves it to the disk


imageFiltersIndex  

Type: class library
Added by: darkelder
Entered: 29/11/2002
Last modified: 01/11/2001
Rating: - (fewer than 3 votes)
Views: 6415
A set of filters that works around the image index, changing it like grayscale filter and sepia filter. It requires uses GD.


ImageInformation  

Type: class
Added by: mikew
Entered: 28/12/2000
Last modified: 01/12/2001
Rating: - (fewer than 3 votes)
Views: 6093
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.


imcache  

Type: code fragment
Added by: kern
Entered: 04/08/2003
Last modified: 09/12/2002
Rating: - (fewer than 3 votes)
Views: 3666
A function for caching images generated by php/gd.


img to imagemap  

Type: code fragment
Added by: joeldg
Entered: 09/10/2002
Last modified: 31/10/2001
Rating: - (fewer than 3 votes)
Views: 4550
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.


Interactive Crop Canvas  

Type: application
Added by: amnuts
Entered: 19/02/2004
Last modified: 03/12/2003
Rating: **** (3 votes)
Views: 12623
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


JPG optimizer  

Type: code fragment
Added by: matthijs_c
Entered: 19/03/2002
Last modified: 03/12/2001
Rating: - (fewer than 3 votes)
Views: 4902
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


Kazanoglu  

Type: application
Added by: kazanoglu
Entered: 30/06/2000
Last modified: 08/12/1999
Rating: - (fewer than 3 votes)
Views: 7426
View images in directory


Linediagram  

Type: application
Added by: Haenk
Entered: 05/09/2000
Last modified: 01/12/2000
Rating: *** (3 votes)
Views: 6707
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.

needs gd & libpng

comments? -- frank@boehm.to

fixed the link [07.09.2000]


phpixel  

Type: code fragment
Added by: tulipan
Entered: 04/07/2000
Last modified: 08/12/1999
Rating: ***** (24 votes)
Views: 11009
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


picture_page  

Type: application
Added by: ray99
Entered: 18/05/2001
Last modified: 05/12/2000
Rating: - (fewer than 3 votes)
Views: 7671
combination of several code snipplets to have your visitor upload a picture and some comment + show a listing on the same page


Publish all images of a directory automatically. Add title, description, home-link  

Type: application
Added by: toko
Entered: 20/08/2001
Last modified: 08/12/2000
Rating: - (fewer than 3 votes)
Views: 8472
Publish all images of a directory automatically. Add title, description, home-link. Exclude files of your choice.


Random image from a directory  

Type: code fragment
Added by: mattr
Entered: 19/07/2000
Last modified: 02/12/2004
Rating: - (fewer than 3 votes)
Views: 6577
Generates a random image link from an image directory.


Random Pic  

Type: code fragment
Added by: cre8or
Entered: 21/03/2000
Last modified: 08/12/1999
Rating: **** (12 votes)
Views: 9392
Simple php random picture, every time you reload the site it changes the picture. Simple but effective.


Remote image checker  

Type: code fragment
Added by: robF
Entered: 16/06/2003
Last modified: 06/12/2002
Rating: - (fewer than 3 votes)
Views: 4201
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.


showing in directory images  

Type: application
Added by: salak
Entered: 04/08/2000
Last modified: 08/12/1999
Rating: *** (3 votes)
Views: 6748
showing in directory images


Simple Image Counter  

Type: application
Added by: vishnu
Entered: 02/03/2000
Last modified: 08/12/1999
Rating: **** (9 votes)
Views: 12065
Simple PHP Image Counter by Hunje Cho


Star Generator  

Type: class
Added by: rustybrick
Entered: 12/03/2001
Last modified: 03/12/2000
Rating: - (fewer than 3 votes)
Views: 6040
a class to generate stars given a radius and the amount of points on the star


Strip Images Function  

Type: code fragment
Added by: regexpro
Entered: 08/11/2002
Last modified: 01/11/2001
Rating: - (fewer than 3 votes)
Views: 4214
A little function for stripping images from HTML contained in a variable.


Text on Image  

Type: class
Added by: eliteboo
Entered: 04/01/2003
Last modified: 02/12/2002
Rating: - (fewer than 3 votes)
Views: 7597
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);



Search



This Category All Categories