Sharpen an image using PHP and GD

PHP and GD can sharpen images by providing a matrix to imageconvolution:

// create the image resource from a file
$i = imagecreatefromjpeg('otter.jpg');

// define the sharpen matrix
$sharpen = array(
	array(0.0, -1.0, 0.0),
	array(-1.0, 5.0, -1.0),
	array(0.0, -1.0, 0.0)
);

// calculate the sharpen divisor
$divisor = array_sum(array_map('array_sum', $sharpen));

// apply the matrix
imageconvolution($i, $sharpen, $divisor, 0);

// output the image
header('Content-Type: image/jpeg');
imagejpeg($i);
Otter, before and after sharpening

Otter, before and after sharpening

Image courtesy Kevin Law

Posted in code | Tagged , , , | Leave a comment

ZooPHP – a PHP wrapper for Zootool

I’ve been using Zootool more and more recently to bookmark things I see on the web. The visual representation of saved items works better for me than Delicious and browser bookmarks are a non-starter these days.

Since the news of an API last week, I’ve been working on a little class wrapper – partly to hone my OOP skills and partly to support some great work by Bastian – and my class is now ready. I’ve named it ZooPHP.

$zoo = new ZooPHP($key, $secret);
$zoo->getPopularItems();

Continue reading 

Posted in code, development | Tagged , | Leave a comment

Firefox Themes causing out of position pixels

That Web Guy had a problem with a design not being pixel perfect – only it turned out to be down to the theme he was using in Firefox. Bug?

Posted in code, development, software, web | Leave a comment

Google Reader adds filters to ‘Mark as Read’

Users of Google Reader can now declare partial feedreader bankruptcy – feeds older than a day, a week or two weeks can now be marked as read, rather than wiping everything.

Filtering which items to flush in Google Reader

Filtering which items to flush in Google Reader

Posted in software, web | Tagged , , , | Leave a comment

Orbicule and MobileMe to overlap functionality

In a post on forthcoming OS support for Orbicule, support for sending a message to an iphone and remotely playing a noise is mentioned. With the recent release of iPhone OS 3.0, these are the major selling factors Apple is using to entice users to MobileMe.

With all the reports over the approval process for apps being submitted to App Store, can Orbicule guarantee that their app will get through with these features? Apple previously refused to approve Podcaster on the grounds that it duplicated the functionality of the podcast section of iTunes.

Posted in software, technology | Tagged , , , , | Leave a comment

WordPress plugin: External Files

External Files is a WordPress plugin which allows authors to insert code snippets from a file or url and automatically syntax highlights the code. Authors can specify the lines to show (or show the whole file/url) and override the automatic highlighting option.

To use, put your file path/url in the shortcode [external].

Click here to download External Files

Posted in Uncategorized | Tagged , , , | 4 Comments

WordPress Plugin: Feed Extensions

Feed Extensions is a new plugin that allows you to add a footer to the end of each post in your feed. The content can be added via the settings page (under Settings ยป RSS Extensions) and comes with a set of inserts which can be used to show various things such as the blog url, a security hash of the post or the author name.

The plugin will be available very soon.

Posted in wordpress | Tagged , , , | 2 Comments

Add an address lookup to your web forms – Part 1

In this tutorial I’m going to show you how to add an inline address lookup to your web forms using the PostcodeAnywhere webservice and the Yahoo! Connection Manager.

Continue reading 

Posted in code | 3 Comments

Feed readers for OSX

It’s been a week since I bought my first Mac, and i’m starting to install software that I knew I could only manage a week without – the first of which is a feedreader.

I use Newsgator online and therefore have a paid FeedDemon install on my Dell laptop, as these synchronise. This means I can read stuff in FeedDemon when i’m at my desk and Newsgator when i’m not without having to read the same items twice over.

This presents an obvious choice for a Mac feedreader – NetNewsWire (Lite). This also synchronises with Newsgator and so will save me a lot of time and effort during the daily catch-up.

I feel though that as Newsgator brought in each component, they have done the bare minimum to integrate it into the brand. Neither of the application-based readers under the Newsgator umbrella do any more than synch with Newsgator. Surely it would make more sense to have them support the same features and synchronise settings (ie flagged items, watch lists) with Newsgator instead of simply synchronising subscriptions. One step further would be to bring the same look and feel to both feedreaders – if iTunes can look the same on both Windows and Mac, then FeedDemon and NetNewsWire can.

RSS is a technology that is begging to be jumped on by the uneducated masses – as shown by the inclusion of feed readers in IE7 – but Newsgator don’t seem to have spotted this potential yet.

Posted in software, web | 2 Comments

Windows-based Macs without OSX

I was reading an article by Sam Gerstenzang entitled ‘Why Boot Camp is the Beginning of the End for Windows‘ (ok, so i’m four months behind on my feed-reading) and mostly I agree with his conclusion, that although Boot Camp enables more of the market to run Windows, it will eventually cause the downfall of Windows itsself.

One thing that occurred to me is that even when (if?) Boot Camp is to be included in the upcoming OSX Leopard, users still need to run the program within OSX to install Windows on a Mac.

If I were Steve Jobs, I’d plan to integrate Boot Camp into the wizard that OSX launches (to configure the machine) when a new Mac is first used by the end user. If the options available were…

  1. Customise OSX
  2. Customise OSX and install Windows
  3. Just install Windows, and set it as the startup

…Apple would be able to catch the market of users who will never want to leave Windows but do want a reliable and stylish machine. This wouldn’t necessarily speed up the downfall of Windows, but would bring Apple some of the market share currently owned by Dell, Lenovo and other large scale hardware manufacturers.

Posted in software | 3 Comments