Browse | Submit A New Snippet

Snippets by category: Graphics

Snippet ID Title Creator
Snippets
131List to SWFtransistor
This script takes an array and generates a SWF file of this array as a list
You can control the size of the list, and font size.
This script uses the Flash Synthesizer library available at: http://reality.sgi.com/grafica/flash/
57Text to PNGhermanv
Render TTF Text to PNG.
Text message, font, size, rotation, padding, color, background, and transparency can all be defined via URL.
88Text to GIFmbrun
Converted the "Text to PNG" class so that it works with GIF's.
120Grey Image with Coloured Mouse Overthepriest
The src for the image must be relative to the
script file the function is called from.

Dont forget to echo the function (html is in the return value)


It doesn't look too bad,

Enjoy!!
318Database Image Sizejoe666
This code will retrieve the size of an image stored in a Database as a BLOB. It uses a variable with the BLOB data in it to do it so and it will return a two element array with the width an height of that image. It has support for JPEG, GIF and PNG as well.
223button buildersmarlowe
Allows you to upload a button background, then select a font, text, size, and color to place on top. Very simple little script.
231GifPix - create gif on the fly without GD darkelder
Create a 1x1 gif file without GD; just say the color. You can create a incolor image too. Make to use with stats bars.
1432How to resize an imagetallguy0202
How to resize an image to fit in a desired space.

With this script you can upload images
gif,jpg,bmp.
In the submit form you can provide
the max height and max width needed.

After submitting the uploaded image
file will be resized to the new
max height and max width provided.

On the http://www.get-on-top.com/image_resize/resize.php
you can find the Example form
you can also find the php code for the script.


Example below

http://www.get-on-top.com/image_resize/resize.php
1211Image Resizerjoele29
Resize the image without altering or creating new resized image file.

Display your image in thumb or specify the percentage size for fast loading displaying in the browser, no need to created another resized image file, this script will do the job for you, it will not alter the image itself, it will only resize once display in the browser.

Sample how to use it : <img scr="resizer.php?imgfile=image.jpg&percent=0.3" border=0>
242Show all images and related informationbillp
This page makes a table that gives the name of each image in your image folder; gives the size and type of the image; shows the image itself is shown full-size. To use this page, save the code as a .php file outside your image folder.
1201ImageGallerygiversen
ImageGallery is an easy to use PHP image/photo gallery with the ability to resize pictures on the fly and show them.

ImageGallery creates a thumbnail index of the pictures and directories. Thumbnails are generated on the fly and cached. ImageGallery also allows viewing pictures in different resolutions. The pictures are also resized on the fly and cached.
271Dynapicmorphy
class to create thumbnails on the fly
284MATH ART 2exequit
Uses lines to build a wireframe concav deltoid
283MATH ARTexequit
Uses y=x^3 function to create a symetrical leafy structure
1210Write Text to the Imagejoele29
Write a text to your image without altering the image itself.

Normally if you have an exclusive pictures you normally place your domain name as a symbol that you own the picture, but if you have hundred or more pictures it will be time consuming adding a text on each of the pictures.
This simple script will do the job for you by adding text in the top location of the picture once called and will not alter the picture itself, so you can change the text in the image anytime.
Example: <img src="img.php?imgfile=image.jpg&text=YOURTEXTHERE"> )
385GraPHP-ICpoissee
PHP Library to draw graphics, histograms ...
351Dynamic Image Rotationjayrox
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
390The Dynamic Duo: barcode.php & barcode.cgischm0e
initial version for dynamic UPC code image generation using php, perl, a flat file, and GD::Barcode
395WBMP for WMLarmzy
We are able to create WBMP for WML by GD-1.8 or later.
416Imagebrowserdemol
Drop this file in any image directory that you want and it automaticaly generates an easy to use browsable interface for your images
1241Graph of the type cheese 3Dfernando_gomes
it allows to the creation of graficos 3D, the data can be gotten through one bd, it functions well, it needs the library php_gd2
438Gradient Imagehitek
This script takes a height, width start color and end color (In hex) and generates a vertical gradient jpeg using GD. The script is written so it can be called from an image tag like this:
&lt;IMG SRC='gradienti.php?h=400&w=600&sc=FF0000&ec=FFFF00'&gt;
442Determine the tone of web colorslemapp
The basic problem that I faced was to determine if I needed to print white or black text over a color background. Since I allowed for the background color to change in my project, I need a way for PHP to determine the color tone. I did some research and the following script is that outcome. Since reds are lighter than either blue are green, I weigh them heavier towards white. This function assigns a tone value in the range of 0 for black to 6 for white. The function then returns the HTML color code for white (FFFFFF) is the background color is dark and black (000000) for all other colors. Now I can sfaely print text on any background, even if I do not know what the actual color is.
446Galleria v. 1.0drtebi
This simple script will automaticall generate an index page with thumbnails, which link to the full size picture.
The script includes a set of default variables which let you change colors, fonts, borders etc.
See the script comments for details.

1284Progressive Image Switcher - Croppertthomas327
Change Progessive Images to Non-Progressive Images and Thumbnails for Flash applications. This script can also be used to dynamically create cropped thumbnails for any application.

This script was only written for Jpeg images, because JPEG images that are progressive can not be displayed in Flash applications using ActionScript. I'm sure it can be enhanced for other Image types.
495Vdc Photo Gallerylabradornic
It's a web photo gallery written in php 3.*++, Js, CSS1.
It gets images from more than one directory in the File System and put them in a web page with a custom number of visualization.
1329Swape.gallery lightswape
This is the most lightweight gallery. You don’t need any database to store the pictures. No admin page or no maintaining at all.

All you have to do is putt your pictures under ./pic directory that is placed under sg/ directory and it wil do the rest.

You can organize your pictures by category by putting it under sub-directories under ./pic directory.

Download it from here.
http://swape.net/blog/content/view/57/59/
1215Change Table and page back colorkhabir
This is the technique to use session and change the color of the page as you like.One can use the database to store color value and set when the page is loaded.save script as php file.
517Embed Flashnyquist
Embed Flash swf's in php using a function call from another php file
525GDLib Hit Counterdavent2
A graphic hit counter that uses the GD Lib to Merge a background with the number images
1235ImageThumbolivomarco
ImageThumb is a small piece of software written in the PHP language that lets you create thumbnails on the fly for a given image, whether it is local ore remote.
Currently supported formats are GIF, PNG and JPEG.

To use this script, you must have the GD library installed, and obiously a webserver capable of running PHP scripts.
1237swape gallery lightswape
swape.gallery light is an online picture-gallery. It dose not use any database to store data. and generate thumbnails on the fly.
1238bar chartfernando_gomes
it is an example of a classroom that allows to create bar charts 3D, the data can be gotten through a table
574Thumbnail Functionkhaine
A simple function that takes a png image and creates a thumbnail in a subdirectory.
1333Latex Renderer Class for linuxcsegura
Latex Renderer Class for linux without any other install, no cgi needed, only /usr/bin/latex /usr/bin/dvips and /usr/bin/convert
1244swape gallery lightswape
Online web-album. Easy gallery system with no database or other thing then php is required.
6432D Line Plot (fully working)baatsaam
Let's you put title, x & y axis descriptions, grid, etc. I don't have time to update/add to it, but it's "completed" so I thought it might be useful to someone else.
1194Create thumbnails and ftp em via command line...anacreo
This will receive the path to a PDF as a command line argument, generate multiple thumbnails at various sizes, then ftp them to various locations. This is meant to be a command line script not a web page...
1198Image Processor 6.2yhorobey
With this script you can easily upload your image, resize it to fit into your design, add watermark or write text to protect your author rights and prevent images theft, you can save several copies on your server like small gray scale copy (thumbnail) and big copy (full size). You can combine multiple operations like rotate or crop to achieve really sophisticated effects.<hr>Features list:</strong></p>
</div>
<ol>
<li>
<div align="justify"><strong>Image creation:</strong></div>
<ol>
<li>Create image from<strong> file</strong>, types supported:(GIF,
JPEG, PNG, XBM, WBMP)</li>
<li>Create image from <strong>uploaded file</strong>,
just specify what is name of file field in your form!
[&nbsp;<a href="demo/test_upload.php" target="_blank">demo</a>&nbsp;]
</li>
<li>Create image from <strong>data stream (string)</strong>,
useful if creating image from the Database [&nbsp;<a href="demo/test_mysql_show.html" target="_blank">demo</a>&nbsp;]</li>
<li>Create image from <strong>base64</strong> encoded
data stream. [&nbsp;<a href="demo/test_createfromstring64.php" target="_blank">demo</a>&nbsp;]</li>
</ol>
</li>
<li><strong>Image manipulation: </strong>
<ol>
<li><strong>Resize</strong> [&nbsp;<a href="demo/test_resize_form.html" target="_blank">demo</a>&nbsp;]
<ol>
<li>Resize to fit into given region, keeping X to
Y ratio</li>
<li>Resize to cover given region, keeping X to Y ratio</li>
<li>Resize to given width/height not keeping X to
Y ratio <font size="-1">(if you do not care about
geometrical distortions)</font></li>
<li>Resize image in such a way that result image will
have given width, no matter what height could be,
keeping X to Y ratio</li>
<li>Resize image in such a way that result image will
have given height, no matter what width could be,
keeping X to Y ratio</li>
</ol>
</li>
<li><strong>Rotate</strong> [&nbsp;<a href="demo/test_rotate_form.html" target="_blank">demo</a>&nbsp;]
<ol>
<li>You can easily specify what should be <strong>background</strong>
of result image. Color names like &quot;yellow&quot;,
&quot;blue&quot; and all others are accepted. Or
just specify RRGGBB just like in HTML</li>
</ol>
</li>
<li><strong>Crop</strong> [&nbsp;<a href="demo/test_crop_form.html" target="_blank">demo</a>&nbsp;]
<ol>
<li>Specify left top corner of rectangular region
and width/height and this function will return cropped
image.</li>
</ol>
</li>
<li><strong>Text</strong> [&nbsp;<a href="demo/test_text_form.html" target="_blank">demo</a>&nbsp;]
<ol>
<li>Write text over the image, </li>
<li><strong>HTML style colors</strong> supported.
(you can specify color as &quot;DCDCDC&quot; or
&quot;gainsboro&quot; )</li>
<li>Built in and custom bitmap fonts are supported.</li>
<li><strong>True Type</strong> fonts (TTF) are supported
(requires Free Type library)</li>
<li>Write in different directions (TTF only)</li>
<li>Write in <strong>different sizes</strong> (TTF
only)</li>
<li>Easy to do different effects like <strong>shadow</strong>
or <strong>highlight</strong></li>
</ol>
</li>
<li><strong>Watermark</strong> [&nbsp;<a href="demo/test_watermark_form.html" target="_blank">demo</a>&nbsp;]
<ol>
<li><strong>Resize</strong> watermark image before
apply</li>
<li>Make watermark image <strong>gray scale</strong></li>
<li><strong>Specify transparency</strong> for the
watermark</li>
</ol>
</li>
<li><strong>Gray scale</strong><strong></strong> [&nbsp;<a href="demo/test_gray_scale.php" target="_blank">demo</a>&nbsp;]
<ol>
<li>Convert image to grayscale (256 grades)</li>
</ol>
</li>
<li><strong>Shadow</strong> [&nbsp;<a href="demo/test_shadow_form.html" target="_blank">demo</a>&nbsp;]
<ol>
<li>Makes nice semitransparent shadow</li>
<li>Fills uncovered regions with specified color</li>
</ol>

</li>
</ol>
</li>
<li><strong>Multiple operations support</strong> [&nbsp;<a href="demo/test_mult.php" target="_blank">demo</a>&nbsp;]
<ol>
<li>You can change image in some way, then remember changes,
then apply another change, save, and so on. After you
are ready you can output the result image. Using this
feature you can produce very sophisticated effects.<br>
</li>
</ol>
</li>
<li><strong>Image output </strong>
<ol>
<li>You can output image <strong>to file</strong>, ( JPEG,
PNG, XBM, WBMP) Note: GIF is copyrighted and is not
yet fully supported in PHP/GD</li>
<li>Output image <strong>directly to browser</strong>,
useful to create and process image &quot;on fly&quot;
from within &lt;img src=&quot;yuorscript_using_ss_image.php?parameters=here&quot;&gt;
tag
691Multiple Image upload -> JPG & SWF thumbnailmikikg
This nice script do following:

1.Upload to server up to 10 JPG pictures
2.Rename files with given index
3.Create SWF images from uploaded pictures
4.Create JPG thumbnails
5.Create SWF thumbnails

Script require MING and GD2 library.
780Matrix Binary JPEG Generatorcjpbob
A script that generates a random image in the Matrix Binary style. All aspects of the image generation can be defined through the built in script interface, including:
Digit Color
Backround Color
Image Resolution
Unoccupied Space
Font Style
Additional Chars.
See working Script at http://delta.glypto.com/~cjpbob/imgtext.php
815Getting width/hight of an EPSquicknik
This snipped should be able to detect width and height of an EPS (at least Photoshop EPS).
823SVGraPHPjenspo
Dynamic Graph drawn with SVG and PHP
889svg-php diagramjenspo
Coloumn diagram with series and x-axis labels
830Command Line Picture Mergeberggrenwl
This will combine 2 pictures. 50% on left and 50% on right. It will also scale down to 400x300 for ebay and put a border around it.
This script runs on command line if imagemagick and php standalone are installed.
863webYourPhotos 2.5 Image Gallery Scriptandreas666
webYourPhotos creates:
1) the thumbnails
2) a thumbnail-htm-page
3) a single htm page for each of your photos with meta tags (created from the name of the pictures, the folders name, and your picture description(optional)
and its easy to use: just load up a folder with your pics and webYourPhotos.php4 to your Server and run webYourPhoto once - thats it...
1301slugtrailbrightdayler
takes a string of characters as elementary instructions and draws a pattern. see example at http://www.eldwick.org.uk/?q=node/31
910Simple Picture Gallery Managerspajot
SPGM is a simple PHP script that displays picture galleries on the web. It is intended to provide a very straightforward way to set up online photo albums: create directories, fill them with pictures and upload. SPGM generates HTML 4.01 compliant code and makes extensive use of CSS stylesheets to render galleries. It only requires PHP version 3 or higher and does not rely on image manipulation libraries (like GD), or any database system. A few features: caption for each gallery/picture, infinite sub-galleries hierarchies, per gallery complete configuration (inheritance supported), new pictures highlighting (filtering available), multi-language support, themes available for use.

Website: http://spgm.sourceforge.net
943Extended EPS Informationfschaeffer
Reads EPS-image information of all images in a folder.
Delivers width, height, resolution (rounded), and decides if EPS is CMYK or other color format.
This is my first version, trying to work on it in future but for me its ok right now.
If someone is able to calculate resolution more properly, hey you're welcome.
Same for color type
975GD2+ thumbnail / image manipulation classpootergeist
An extensive image manipulation class that easily handles stacked transformations and thumbnailing. Including:-
bevel
greyscale
drop shadow
motion blur
ellipse
frame
merge
and edge rounding, all with user defined parameters. Note that it is GD2+ and outputs compressed jpeg images. Licensing is free for all non-commercial non-profit use.

Usage: output size of the transformed image is governed by reading dimensions of a base_file. Neither of the dimensions can be exceeded by the generated image - so a 200px square base image would result in thumbnails that fit within that area. If you pointed the base_file back at the resource_image then no resizing would occur.
Multiple transformations can be effected during one call - for instance, you could perform an ellipse followed by a greyscale, a bevel and finally a motion blur (not saying that would look nice - is possible though).

Remember to set permissions on the folder you want to save the manipulated image in.

Online (html interfaced) example at: http://www.teckis.com/compiled_files/img_create.php
1034Php Script for RChartjava4less
This script shows you how you can use Php with a java applet to create charts. The advantage of this approach is that it does not require any special library on the server side and it provides interactivate features (zoom, scroll, links and tips) on the client side.

More information at
http://www.java4less.com/charts_e.htm
1315PhpMyBorder - add round borders using CSSphpmyborder

Tables and other types of page elements may have borders that may be presented in different styles.

Rounded borders are often interesting to provide page elements the sense of three dimensional depth.

Rounded borders styles are being introduced with CSS 3 standard. However, this version of CSS standard is not yet being supported by most of the current browsers in use.

This class provides an alternative solution that uses images to render rounded borders of configurable size and presentation style.

Dynamic generation of border images is usually an heavy task, especially for busy sites. This class employs caching to reduce the border image generation overhead.

PS! version 2.0 is available at http://www.phpmyborder.com
1067Thumbnail Scriptznoort
Very useful for creating multiple sizes of image urls from single images
Creates a thumbnailed image based on info passed to it via get.

Images are cached on the server, so server processing overhead is only
needed for the first time the script runs on a particular image.

Updates available at http://mightystuff.net/thumbnail_script
1079the_button.phphuolong
create a dynamic button-image with variable font,color,margin and corner-rounding. uses external 'style' files and URL variables.
1080imcache kern-online
A simple function for caching images generated by php/gd.

http://www.kern-online.dk/phps/imcache.phps
1104UK Postcode Mapfrogrocker
This takes a postcode as a get variable, then converts it to a longitude and latitude from a database.
It then plots this position on a map of the UK.

*NOTE: You need to have GD installed*
1115Number Verification, used to prevent form auto-completescrazy736
This code contains two files, pic.php and numverif.php. numverify.php generates a random 10-character code using uppercase and lowercase letters, and numbers (A-Z,a-z,0-9). It send this information to pic.php, which takes the random code and inserts it into a .png image. The it prompts the user to enter the code. If correct, it says. If incorrect, it says. Very simple but may be modified. This is used to prevent forms from being auto-competed by some program. Have fun!
1116HUE shiftozzythaman
this is a little script for shifting HUE in an image (remember hue, saturation, brightness?) in other words it means shifting the colors of a picture, for example red becomes green, gren becomes blue, blue becomes red.
Do whatever you want with it, but remember who's tha man...
1161Simple Horizontal Bar Chart using GDicornwal
Function to create a bar chart by passing an array with labels as the index and the value, and a filename for the image.
1130Image Sizethepriest
A command line php script to return size & type of given image file(s).
Works with file globbing.
NOTE: NOT tested on Windows.
GD is NOT needed.

1. copy the source into a file (i call it "fs")
2. make it executable
3. move it into your ~/bin directory

I have found this script useful for getting sizes of a group of images when doin
g web stuff.
1139RChart Php Editionjava4less
This example shows how to create a chart using RChart Php edition. The example creates a combination of line and barchart with 2 Y axis (left and right).

The complete RChart package can be found here:

http://www.java4less.com/rchartphp/index.html

1156gImage classsh4d0wn
A simple class for generated image thumbs.
1162Image Properties Viewershanki31
This is a basic code snippet,useful for PHP newbies, which lets the user browse through the local system and get the dimensions of gif/jpg files along with viewing the image. Compatible with the PHP 4.0/Apache 3.0 and later versions.
1367JPG D'ocument Viewer in Flashtufatmarketing
This isn't exactly an Advanced Flash System, but it's a bit more complex than the other applets available on TUFaT.com. It operates in much the same way as the applets, however... a simple XML file controls the display and behavior of the Flash SWF.
1369Fast Flash/XML Gallerytufatmarketing
A FAST, lightweight (small SWF), and easily configurable image gallery. This is designed with ultra-low bandwidth and ultra-fast loading in mind. This gallery includes 4 advanced layout options and a dozen configuration options packed into about 18 KB.
1370Flash WYSIWYG editortufatmarketing
FlashArea is a good choice if you need WYSIWYG capabilities for a Flash-based website, or if you just want to ensure that your WYSIWYG textareas look consistent across all browser platforms, or if you just like the "Aqua" or "XP" look to FlashArea.
1372Flash Greeting Card Makertufatmarketing
Send JPG greeting cards to your friends with this Flash MX card designer. Includes dozens of advanced drawing controls, and is highly customizable!
1378Flash/XML Image Displayerstufatmarketing
5 Flash image rotators. These are great if you want to quickly display your images with some cool transition effects, but don't need a full-fledged gallery system. All images are externally linkable to the URL of your choice.
1384php class for basic image manipulationstefangabos
A class providing a set of methods for doing basic transformation to an image like resizing, rotating and flipping. the class is very small (only about 18Kb in size but still heavily documented) and as i said it only covers some basic methods so don't expect miracles. i use it in favour of many other well known scripts that are hard to install, hard to manage, have a thousand files, many megabytes in size and zillions of methods and functions nobody uses. this is how i do it - download it from here <a href="http://stefangabos.blogspot.com/2006/08/zebra-php-framework-image-transmform.html">http://stefangabos.blogspot.com/2006/08/zebra-php-framework-image-transmform.html</a>
1400How Tosamuelito
I'm Trying to install GD library and Jgraph, What i'm Trying to do is the example which is this one:

And i dont know what is wrong, it is suppost to display a box. but i dont undertand why it doesnt do it.
1402Graph ITtyrkelko
Graph IT - Display dynamic graph on your website using this free code - input can be by sending the data or sending a link to a file with the data
See example of script usage on <a href=http://www.3dpictor.com>3D Pictor</a>
I would appreciate a link back to http://www.3dpictor.com from the pages displaying graphs using this code
1407Ajax Buttons Generatorwarrior
Buttons Generator for CMS (OsCommerce, CRE Loaded, Zen Cart, OscMax). Easy to generate full buttons package. Help to designers in template creation and integration.


Features:
Generate buttons package for CMS;
Ability to use different fonts, font colours, font size, font padding, uppercase etc. ;
More than 50 button templates and ability to upload own button pattern;
Works fast and flexible with Ajax.
1415jGallery - PHP based photo album viewerkooijman77
jGallery provides you with a menu with which you can brows your photo’s online. The menu shows you your current position and you can always switch back home.

Example and download at: http://portal.kooijman-design.nl/jGallery/

You can change themes, cols and rows in your gallery and thumbnail sizes.

jGallery can be included from a higher directory and will function the same.

You can install a existing theme or edit the one you have installed by editing the stylesheet and theme-configuration file.
1428Image Verification for Form Submissionrrijnders
Quick snippet I put together to display random numbers in an image on a form. The user types the numbers he/she sees into an input box on the form to validate that it is a human filling out the form and not a bot.

Numbers are random by font, size, and position in the graphic. Size of the graphic and number of digits are easily controlled to your liking. The numeric representation of the image numbers is not stored in the form, so bots can not get at it to circumvent your security.

There are two snipets here. The first, "send_imagever.php" generates the graphic and stores a hash of the real number in a session variable. The second, "stub_imgver.php" is quick stub to demonstrate the use of the code.

1445Line Chart/Graph Class using GDthestonefox
A quick (dirty) class I wrote to plot a line chart based on given values. It is quite basic but is fairly usable.
1446Example of how to use Line Chart/Graph Classthestonefox
In reference to
http://www.phpbuilder.com/snippet/detail.php?type=snippet&id=1445
1450FlexPHPic Promilly
FlexPHPic Pro is a simple, free and open source picture admin system. You can add multi-level sub-categories and classify the pictures. It is easy for internationalization. Users can search pictures and categories by keywords, browse pictures online as Acdsee, zoom in, zoom out or print the pictures, and add filter effect for the pictures. Automatically generate thumbnails(GD library required)Low price customization service available.
1451FlexPHPicmilly
FlexPHPic is a simple, free and open source picture admin system. You can add multi-level sub-categories and classify the pictures. All the text in this program is put in one file. Once you edit this file, you can generate a new language version or customize the text in your program. Users can search pictures by keywords, browse pictures online as Acdsee, zoom in, zoom out or print the pictures, and add filter effect for the pictures.Low price customization service is provided.
1459Google map plotter Class in PHP5rahuls108
Hi,

Just now I have written a class which will plot a google map on your page using address as a input parameter.
I am sure you all find it very useful, if you have any questions/suggestions mail me at
rahul@zimaudio.com or post a comment directly into forum.

Thanks.
1469jGallery 2-RC1 :: Image gallerykooijman77
jGallery is PHP-based photo album software for setting up a picture gallery on your website. After uploading the extracted package you can manage the content of the albums. JGallery creates thumbnails for you to improve picture browsing.