News Feed
Sections




News Archive
feed this:

Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

.Net Magazine:
Create an SVG data visualization with PHP
September 13, 2011 @ 12:13:25

On the .net magazine site (yes, really) there's a recent post from Brian Suda about creating SVG images with PHP thanks to the GD functionality that's included in every release.

If you're working online, then canvas springs to mind. It allows you to draw raster graphics quickly and easily. If you want, there are also plenty of image code libraries that can generate GIFs, JPEGs and PNGs on request. But what if your target isn't always online? What if you're aiming for print? Then you could use a raster graphic, but it would need to be pretty large. A better solution is to create a vector-based image format from your code. This is where SVG (Scalable Vector Graphics) steps in.

He starts by explaining a bit about SVG and what it is for those that haven't worked with it before. He givesn an example of a poster from Wired showing circles with colors from their covers over the last 15 years. He shows how to do something similar with images of the .net magazine covers, pulling out the color frequency with the imagecolorat function. Toss in a bit of markup and some formatting of the color output and you'll get circles with concentric rings with the most prominent colors ending up the largest. You can see his result here.

0 comments voice your opinion now!
svg tutorial gd image color frequency


Zend Developer Zone:
Creating Scalable Vector Graphs with PHP
March 09, 2010 @ 10:27:54

A new tutorial has been posted to the Zend Developer Zone today looking at making scalable vector graphics with PHP and the hep of one of two charting packages - ezcGraph or SVGGraph (examples are provided for both).

Programmatically generating graphs and charts using SVG requires a deep understanding of the SVG specification and the various SVG primitives, as well as a fair amount of time for research, experimentation and debugging. Or, in other words, that's your entire weekend shot! Fortunately, help is at hand. There are a number of open-source PHP libraries that support SVG chart generation, and using them can significantly reduce the amount of work involved in adding this feature to a Web application.

He shows how to create simple images like bar, line and pie charts as well as adding in other things like a legend, custom titles and a sample where the user can define the sizes of a pie chart via some form input fields. Screenshots are included for all code examples to give you a better idea of the end result.

0 comments voice your opinion now!
scalable vector graphic ezcgraph svggraph tutorial svg


PHPBuilder.com:
Using PHP for the Creation of SVG Images
December 04, 2008 @ 09:37:57

On the PHPBuilder.com site today there's a new tutorial talking about using PHP to dynamically create SVG images in a simple application.

As with many of the pages on my Web site, my SVG images are in fact generated by PHP scripts. I end up including many of the same images in other pages, but not always with the same size or colors, so making them customizable on a case-by-case basis is a useful thing. Attributes such as size, scale, colour, rotation, and position are obtained from arguments in the URL.

His example creates a SVG image using a class (UIControl) to create the content for the image. This content is dropped into the typical XML structure to display it. He also includes some extra attributes/methods you can use with the UIControl class to alter the resulting image.

0 comments voice your opinion now!
svg image create dynamic tutorial example


DevX.com:
Add the Graphics Power of SVG to PHP
February 26, 2008 @ 10:44:00

In this DevX tutorial, Octavia Anghel shows how use PHP to create images based on the SVG libraries available to any browser.

Scalable Vector Graphics (SVG) is an XML specification for producing vector-based graphic content that you can create, modify, and manipulate dynamically from programming languages. Here, you'll explore the most important techniques and libraries for integrating SVG with PHP to create diverse graphic content'"from simple shapes to complex graphs.

They show a few different ways to get the job done including a straight 'echo' call with the output, sending a converted SVG document over with a PHP header or including another (or multiple) SVG documents into another and outputting them. They also talk about tools like the phpHtmlLib library, the PEAR::XML_SVG package and the PEAR::Image_Canvas package.

0 comments voice your opinion now!
svg graphic tutorial echo output include dynamic


Kore Nordmann's Blog:
Comparision of PHP image libraries
December 13, 2007 @ 12:07:00

Kore Nordmann has written up some benchmarks of some of the more popular PHP image creation libraries testing their output times and results for generating the same image.

In my article series I showed several ways on how to create images with PHP, going into implementation details etc. Now I just want to provide a very rough overview on speed and quality of the extensions.

He ran them with some settings disabled to optimize things as they ran and came up with results pointing to Cairo being the fastest to generate and output the image. It also had the benefit of outputting an image with the highest quality of the five tested (Cairo, SVG, Flash and GD with and without supersampling). His benchmark code is also included.

0 comments voice your opinion now!
compare benchmark image library cairo svg flash gd compare benchmark image library cairo svg flash gd



Community Events





Don't see your event here?
Let us know!


install language release interview symfony api wordpress community series list introduction application code unittest configure podcast laravel developer threedevsandamaybe library

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework