![]() |
Simple pixelate + negative functions
So over the last few months I've developed a few helper functions for some image related stuff I've been working on using PHP and GD and thought I would share them...
The filters simply introduces a function to pixelate an image resource and the second one makes all colors negative just like the imagefilter($im, IMG_FILTER_NEGATE) function, however since this is written in PHP theres really a difference in using my version and the C version, so use that if possible. Sources: PHP Code:
Prototypes: bool imagepixelate( resource $im, integer $blocksize ) Pixelates an image $im - A valid resource to a GD image $blocksize - How many pixels that should go on each block, 1 = no effect because 1 = 1 pixel bool imagenegate( resource $im ) Reverses color and creates a negative effect $im - A valid resource to a GD image Cheers, hope this will help someone ;) |
Cool! I've got to check this out right now!
|
| All times are GMT. The time now is 05:29 AM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0