 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
Mikko Koppanen's Blog: Fill patterns
by Chris Cornutt April 29, 2008 @ 15:24:50
Mikko Koppanen has a quick post today showing how to use PHP and Imagick to create an image of text filled with another image layer behind it:
The fill pattern is used to annotate text but the named pattern could also be used to fill any shapes that allow fill to be specified (include circles, ellipses, rectangles, polygons etc etc).
His example is pretty simple (with a "Hello World!" output) that pulls in the background image, creates the composite layer over it, adds the text to it and sets the fill to the background image's layer. The whole this is wrapped up and output as a PNG file.
voice your opinion now!
fill pattern imagick tutorial example png background image
DevShed: Creating Image Streams from Existing Graphics with the GD Library in PHP
by Chris Cornutt August 20, 2007 @ 11:04:00
DevShed continues its look at using the GD graphics library in PHP with the second part of the tutorial series, this time focusing on the creation of images from existing images (and their streams).
As I stated at the end of the previous article of this series, the GD extension comes packaged with many other useful functions, which indeed deserve a close and detailed look. Thus, in this second tutorial I'll show you how to create different types of image streams from existing graphics, but in this case limiting the process to building GIF, JPG and PNG images.
They work through each of the types (GIF, JPG and PNG) creating an new one from a previous "clouds" image of the same type (a GIF out of a GIF, a JPG from a JPG, etc).
voice your opinion now!
tutorial gd graphic create stream png jpg gif existing tutorial gd graphic create stream png jpg gif existing
AddedBytes.com: Regular Expressions Cheat Sheet
by Chris Cornutt September 15, 2006 @ 07:46:23
One of the more elusive concepts of programming can be working with regular expressions. Now, there's lots of places to learn them and to get a handle on what they can do (such as this book), but what if you don't need the full-blown reference and just want a quick and dirty reference source? AddedBytes.com is happy to be of service with their latest cheat sheet divided up into the different formats (anchors, character classes, assertions, escape characters, etc).
The Regular Expressions cheat sheet is designed to be printed on an A4 sheet of paper and live by a designer or developer's desk, to make life a bit easier. A description of what is on the cheat sheet follows, or if you are impatient, you can go straight to the full size Regular Expressions cheat sheet.
This time, they've posted it in a few different formats, including a torrent file to make for faster/easier download. They still have the usual methods (PDF and PNG) but you'll need to visit the page for those links - it's been requested not to directly link to them.
voice your opinion now!
cheat sheet regular expression pdf png torrent cheat sheet regular expression pdf png torrent
Zend Developer Zone: Cool Image Thumbnail Class
by Chris Cornutt August 30, 2006 @ 07:41:58
On the Zend Developer Zone, they point out a handy little image manipulation class they've come across - GenXDesign's PHP Thumbnail Class - as well as some details about it.
I've seen a lot of implementations of thumb nail functionality in PHP, I've even written a couple of my own. I like this class thought. In looking over the code the first thing you notice is that it's clean code. I don't mean they use the latest whiz-bang method to cshave a few keystrokes.
This code is simple, nicely formatted and easy to read through. My only real problem with the code itself is that it is not terribly well documented. That can be forgiven since easy to read.
Cal talks about some of the other features of the class, including that it works with gif/jpeg/png images, makes it easy to set the quality of the jpgs, and makes it easy to display the dynamic images directly to the browser. Check out the demo for more.
voice your opinion now!
image thumbnail class genxdesign gif jpeg png quality resize image thumbnail class genxdesign gif jpeg png quality resize
Codewalkers.com: Creating a CAPTCHA with PHP
by Chris Cornutt June 07, 2006 @ 05:58:57
Codewalkers.com has a new tutorial posted today showing the creation of a CAPTCHA image with PHP.
You may be thinking just exactly what is a captcha? Well you are likely to have already seen them across the web. They are those little images with a code on the front that you type into a box in order to submit something. This kind of system helps to prevent automatic submitting of an operation by some kind of program or robot. In this tutorial I will show you how to make a CAPTCHA [just like the one below]. Its not the most advanced captcha available because it uses a simple system font and nothing more.
They start with a look at how CAPTCHAs work before even looking at the code. The next steps include the creation of the random string of characters and placing them in the image (with a standard background in this case). The image is built with the GD functionality in PHP. Finally, they add the functionality in, checking a session variable, to ensure that the user has inputted the text from the image correctly.
voice your opinion now!
captcha tutorial image gd session png captcha tutorial image gd session png
CodedFX.com: Creating a CAPTCHA for Your Site
by Chris Cornutt April 04, 2006 @ 13:02:51
Via a pointer from the Zend Developer Zone, there's a new bit of code over on CodedFX.com to help you generate a CAPTCHA image to prevent spam messages from bots in your comments.
There's two files in his example - the main PHP that does the work and a font file to pull the text from. The code is pretty straight-forward, and can almost be cut and paste into any kind of application. Working with the font file is a little tricky, but GD has built-in functionality to work with it.
The script allows for any kind of true-type font input, multiple color schemes, transparency, and the ability to angle the letters to make them harder to interpret. The resulting output from his script is a PNG image, but with a few modifications, it could create JPEGs as well.
voice your opinion now!
create captcha image spam prevent GD PNG create captcha image spam prevent GD PNG
ASys DataService's Blog: Rounded corners using PHP and the GD library
by Chris Cornutt January 25, 2006 @ 13:01:50
On ASys DataService's blog, there's an article posted about creating rounded corners on your images with a little help from the PHP GD libraries.
I needed to add rounded corners to some pictures and didn't want to modify the source files in Photoshop (I think it's a bad idea to modify original pictures if the effect can be added dynamically).
That's when I decided to use the GD library, which I had found very useful in other projects. I'm not saying that this solution is perfect or better that others, but it has worked very well for me, and I hope it will be useful to some of you as well. Feel free to contact me if you have any comment about this code.
He briefly describes the code, noting where you can make config changes based on your needs. After that, it's all code, a procedural script that takes in any file and spits back out a custom rounded-corners image with your chosen settings. He even gives a PNG file of the rounded corner to use...
voice your opinion now!
rounded corners GD library png image rotate rounded corners GD library png image rotate
|
Community Events
Don't see your event here? Let us know!
|