Posted by: Shofiur Rahman

Posted on: July 4, 2012 3:46 pm


The basic four steps to generate an image using PHP are as follows:

  • Creating a canvas image on which to work.
  • Drawing Shapes or printing text on that canvas.
  • Outputting the final graphic
  • Cleaning up resources.

Sample PHP script:

// Creating a canvas image

$height = 200;

$width = 200;

$im = imagecreate($width, $height);

$white = imagecolorallocate($im, 255, 255, 255);

$black = imagecolorallocate($im, 0, 0, 0);

// Drawing Shapes or printing text

imagefill($im, 0, 0, $black);

imageline($im, 0, 0, $width, $height, $white);

imagestring($im, 4, 50, 150, 'Label text', $white);

// Output image

header('Content-type: image/png');


// Clean up



Posted by: Ben Austin

Posted on: June 11, 2012 3:28 pm


Want to jazz up your blog posts in an instant? Read on to find out how to add and adjust images within your content if you’re using WordPress to publish your posts!

Add a new post. Type out your post into the ‘visual’ field and space each paragraph out as best suits the content.

Choose which image you want to upload from your PC and copy and paste it into the ‘visual’ field. Alternatively you can select an image from a specific URL or your existing Media Library.

Hover your mouse over the image and select the ‘Edit Image’ tab in its top left hand corner.

Add in the title, alternate text, caption and description details where applicable – remember, these will help optimise your image for the search engines, so be sure to include your main search terms where possible.

Check your link URL is acceptable

Choose how you would like the image to be aligned on the page. You can decide to place the picture to the left, in the centre or to the right, or leave it floating by selecting ‘none’.

Select the size of your image using the handy slider: you may need to return and adjust the size once you’ve established what it’s going to look like on the page

Go to ‘Advanced Settings’ to adjust the space between the image and the text on the page by changing the numbers in the ‘width’ and ‘height’ boxes. You can revert the image back to its original size if you don’t like the look of it later!

Click ‘Update’ and see your changes come to life!