Chapter 1. Why Dynamic Graphics?

1 view
Skip to first unread message

Pterodactyl

unread,
Apr 22, 2007, 2:42:14 PM4/22/07
to Dive Into PHP 5: The Graphics
Chapter 1. Why Dynamic Graphics?

Table of Contents

Overview
Charts
Counters
Galleries
CAPTCHAs

This chapter gives you a strong motivation to use dynamic graphics on
your web sites.

Overview

Very rare web sites have no graphics on their pages. Some graphics are
static, and some graphics are dynamic.

Static images are built with graphic editors such as GIMP and
PhotoShop or come directly from devices such as scanners and digital
cameras. Once created, they never changed. You can use static graphics
mainly as decorative elements and sometimes as illustrative materials.

Dynamic images are generated programmically on the fly. They strongly
depend on data represented and change together with data. Using them
makes your web site alive. Dynamic graphics are in common usage for
making advertisements, thumbnails, custom buttons, charts, watermarks,
and so on. Some of these applications are further explained in the
rest sections of this chapter.

Charts

A chart or graph is a type of information graphics that represents
tabular numeric data and/or functions. Charts are often used to make
it easier to understand large quantities of data and the relationship
between different parts of the data. Charts can usually be read more
quickly than the raw data that they come from. [1][http://
pterodactyl.l2p.net/book/php5image/page/bi01.html#wikipedia]

You can use charts to show almost any type of structured information,
e.g. for your web site statistics as shown below.

Figure 1.1. Example of Chart
[http://pterodactyl.l2p.net/images/Chart.png]
Example of Chart

Counters

A web counter or hit counter indicates the number of visitors, or
hits, a particular webpage has received [1][http://pterodactyl.l2p.net/
book/php5image/page/bi01.html#wikipedia]. Often some extra information
is collected as well. Using your own web counter instead of one
provided by a third-party company brings you even more flexibility.

Figure 1.2. Example of Web Counter
[http://pterodactyl.l2p.net/images/Counter.jpg]
Example of Web Counter

[Note][http://pterodactyl.l2p.net/images/docbook/note.png] Note

At this time web counters are no longer associated with the impression
of professional web design [1][http://pterodactyl.l2p.net/book/
php5image/page/bi01.html#wikipedia]. You can still, however, collect
statistics for more complicated web analytics and use charts to show
it (see the section called "Charts" for details).

Galleries

If you are an owner of an Image Gallery or other kind of web site
based on graphics uploaded by users, you probably need to manipulate
that graphics in various ways such as resizing images, inserting text,
etc.

Thumbnails. Thumbnails are reduced-size versions of pictures [1]
[http://pterodactyl.l2p.net/book/php5image/page/bi01.html#wikipedia].
Use them to give your visitors a short overview of gallery contents.

Figure 1.3. Example of Thumbnails
[http://pterodactyl.l2p.net/images/Thumbnails.jpg]
Example of Thumbnails

Watermarks. A watermark is a recognizable image, or pattern, or text
embedded into an original picture, e.g. for authentication. [1][http://
pterodactyl.l2p.net/book/php5image/page/bi01.html#wikipedia] Embedding
logos and/or web site URLs is in common practice.

Figure 1.4. Example of Watermarked Image
[http://pterodactyl.l2p.net/images/Watermark.png]
Example of Watermarked Image

Formats. Since PHP supports a set of various image formats (see
Chapter 6, Image Formats [http://pterodactyl.l2p.net/book/php5image/
page/ch06.html] for details), you can easy convert images within the
set.

CAPTCHAs

A CAPTCHA[1] is a type of test used in computing to determine whether
or not the user is human. A common type of CAPTCHA requires that the
user type the letters of a distorted image, sometimes with the
addition of an obscured sequence of letters or digits that appears on
the screen. CAPTCHAs are used to prevent automated software from
performing actions which degrade the quality of service of a given
system. [1][http://pterodactyl.l2p.net/book/php5image/page/
bi01.html#wikipedia]

Figure 1.5. Example of CAPTCHA
[http://pterodactyl.l2p.net/images/Captcha.jpg]
Example of CAPTCHA
The image from Wikipedia, the free encyclopedia.

Most humans can pass the test reading distorted text as the one shown
above, but current computer programs can't.

Some Applications

The CAPTCHA Project [4][http://pterodactyl.l2p.net/book/php5image/page/
bi01.html#captcha.net] listed several applications of CAPTCHA.

* Online Polls
* Free Email Services
* Search Engine Bots
* Worms and Spam
* Preventing Dictionary Attacks


[1] An initialism for "Completely Automated Public Turing test to tell
Computers and Humans Apart", trademarked by Carnegie Mellon University.

Reply all
Reply to author
Forward
0 new messages