php-gd

Image comparison with php + gd

What's the best approach to comparing two images with php and the Graphic Draw Library? This is the scenario: I have an image, and I want to find which image of a given set is the most similar to it. The most similar image is in fact the same image, not pixel perfect match but the same image. I've dramatised the difference between th...

how i can merge two images in php without GD

how i can merge two images in php without GD ...

Scale down animated GIF with PHP GD

Is it possible to scale down a animated GIF with PHP GD so that it's still animated? If so, how? ...

How Do I Draw A Slightly Diagonal Gradient Fill in PHP?

I found the following function can draw a vertical gradient in PHP. However, many web designers like their gradients to have an upper-left lightsource to make the gradient look more realistic. So, how do I change the angle slightly on the vertical gradient, making it into a slight gradient? I don't want to completely overdo it, but just ...

PHPthumbFactory file not found on upload

library: http://wiki.github.com/masterexploder/PHPThumb/basic-usage i am using the PhpThumbFactory library to crop and upload an image. the error im receiving is this: Fatal error: Uncaught exception 'Exception' with message 'Image file not found: ' in /www/iaddesign/admin/classes/phpthumb/ThumbBase.inc.php:193 Stack trace: #0 /www/i...

PHP-GD: Dealing with Unicode characters

I am developing a web service that renders characters using the PHP GD extension, using a user-selected TTF font. This works fine in ASCII-land, but there are a few problems: The string to be rendered comes in as UTF-8. I would like to limit the list of user-selectable fonts to be only those which can render the string properly, as so...

PHP-GD: Is it possible to apply a filter to part of an image in one go?

I want to apply a pixelate filter to a rectangular part of an image. Is it possible to achieve this in one go, or should I make two images, apply the filter to the second and ... then what? ...

In PHP, imagepng() accepts a filter parameter. How do these filters affect the function's output?

How do these filters affect the output of imagepng() in PHP? PNG_NO_FILTER PNG_FILTER_NONE PNG_FILTER_SUB PNG_FILTER_UP PNG_FILTER_AVG PNG_FILTER_PAETH PNG_ALL_FILTERS The documentation simply says, "A special PNG filter, used by the imagepng() function" for each of them. It seems that using PNG_NO_FILTER will reduce the filesize of...

PHP - Resize an image and fill gaps of proportions with a color

I am uploading logos to my system, and they need to fix in a 60x60 pixel box. I have all the code to resize it proportionately, and that's not a problem. My 454x292px image becomes 60x38. The thing is, I need the picture to be 60x60, meaning I want to pad the top and bottom with white each (I can fill the rectangle with the color). The...

php script to convert .png to .icns for mac os

I am looking for php script that convert .png file to .icns file for mac. Thanks. ...

Online Image Slideshow using PHP, GD, XML, and Javascript

Hi, I wrote some code to automatically track many objects through an 1000+ frame image sequence. The object boundaries and centers are outputted in xml by my algorithm. I am making a website to show off my results and I would like to have a navigable slideshow with the normal play, pause, forward, rewind features. I currently have a ...

Serving images via `print fread(...)` is slow, what to do?

I have a dynamic thumbnail script I found laying around the web and tweaked a bit. One of the things I added was a caching mechanism. Whenever a new thumb is generated, it is saved to disk, and the disk copy will be used if the same thumbnail (with all the same options) is requested again. A snippet: // name of cached file $thumb_...

How to draw an interactive image in PHP ?

Hi, I know how to draw rectangles in PHP (with GD), but how do we make them interactive ? I mean, is there a way to be notified when and where the user clicks ? Eventually, I would like to enable the user to select a rectangle among a set by clicking on it, and clicking anywhere else to move it. Thanks aforehand. Regards, Mister My...

php , gd, create watermark, change watermark text size and background color, imagecreatefromjpeg

I need to create a watermark apply it on a picture and save it with a different name . The current script works pretty well but the only problem is that I need to increase the size of the "sample text" and change the background from black to white . I tried different scenarios , changed the opacity but still can't change the background c...

PHP: Get image resource size in bytes?

I'm resizing images with php gd. The result is image resources that i want to upload to Amazon S3. It works great if i store the images on disk first but i would like to upload them directly from memory. That is possible if i just know the bytesize of the image. Is there some way of getting the size (in bytes) of an gd image resource? ...