PHP GD Sharpening, Photoshop-style

So I have been working on my thumbnail image sharpening script .. and I am happy to show some MAJOR progress. Go here:

Testbed Image Sharpening

I hope that you can see the difference in detail from the first image to the second. The first image is blurry and the second is sharper.

When all image editing programs take a large image and shrink the image down, what happens is some of the data gets cut out and approximated, occurring in a blurry image.

More intuitive programs like Adobe Photoshop will incorporate better approximation algorithms, but in most cases, still don’t do the image justice.
So the next step is to use a sharpening filter to fine tune the amount of detail within the image. These sharpening filters are based on real-world darkroom techniques that are used by photographers to enhance their photographs. I’m not going to go into detail about how photographers go into the process of sharpening their images, and further how a computer can reproduce the exact same process digitally.

In the end you have a product that removes the blurriness and adds a little detail to the resized image.

I have now taken what I understand from this script and managed to embed it into the NextGEN Gallery Plugin built for WordPress, which I used in my client’s website for his image gallery of his art pieces online.

All of the images upload to the gallery, resize, and then sharpen based on the settings in the admin.

I have passed along the code to the creator of NextGEN Gallery and hopefully he will include it to the next version that comes out!

3 thoughts on “PHP GD Sharpening, Photoshop-style”

  1. Awesome work, mind sharing it? I’m having some problems with thumbnail creation… mainly the quality. 

  2. Yeah, would love the code for this as it still hasn’t been added to the nextgen gallery… it is seriously missing from the code.

  3. Unfortunately my code for the NextGen plugin is no longer usable. There have been many code revisions to NextGen and I dumped it altogether for the much easier to use native gallery embedding in WordPress (sans the sharpening).

    I do want to tie this sharpening technique into one of the plugins for regenerating thumbnail sizes — there’s a great ajax based one for WordPress that avoids the post-timeout issue and I think it’s the best place for it and as well as an option for uploading images too. But I need to look into that.

    I am in the process of moving many small projects and useful codes to github and will update this post as soon as it makes it up there. I don’t have a timeline for that at this time.

    Can I ask why you guys are still using NextGen? (I just want to see why NextGen is still around)

Comments are closed.