Questions tagged [gd]

GD Library is used to dynamically create and manipulate image files.

GD is an acronym for GIF Draw, GD is an open source code library for the dynamic creation of images by programmers. GD is written in , and "wrappers" are available for Perl, PHP and other languages. GD creates , and images, among other formats. GD is commonly used to generate charts, graphics, thumbnails, and most anything else, on the fly. While not restricted to use on the web, the most common applications of GD involve website development.

2961 questions
1
vote
0 answers

PHP imagecopy() erases old image, intermittant

I'm having a problem on a site I made where occasionally, a file I'm overlaying on another file somehow becomes the file saved. Apparently I can't embed images or post more than two links, which makes it a bit difficult to explain what's going on. I…
suvonnie
  • 11
  • 1
1
vote
0 answers

PHP GD Image does not show up correctly

okay, so im using this piece of code:
Malin Pedersen
  • 141
  • 1
  • 1
  • 7
1
vote
2 answers

Saving a transparent image from a URL in PHP

I am trying to build a class that does many photo operations, one method will upload images from a user but I am also needing to build a method to grab a photo from a URL and run other methods on it just like if it were being uploaded with a POST…
JasonDavis
  • 48,204
  • 100
  • 318
  • 537
1
vote
1 answer

superimposing images using GD Library makes them grayscale. Why?

I have 2 images both PNG and i want to create a new PNG image. on which first image will be super imposed. the codes works perfectly and is generating expected image but all the colors are lost and the output is a greyscale image. here is my…
1
vote
2 answers

Getting Font Metrics in PHP

I was wondering if there is anything in PHP that will get me different properties of a font like ascent, descent, leading, height, etc. Something similar to FontMetrics class in java fount…
Romit
  • 96
  • 2
  • 13
1
vote
2 answers

drawing points evenly distributed on a circle

i want to get the coordinates of n points on a circle with the diameter of x i tried this:
roeb
  • 467
  • 8
  • 19
1
vote
2 answers

PHP make fails with error: Undefined symbols _XpmLibraryVersion

I am trying to compile PHP myself on Mac OS X Mavericks. Here is the configure command: ./configure --prefix=/opt/local/php --with-config-file-path=/opt/local/php/conf --with-apxs2=/opt/local/apache/bin/apxs --with-mysql=/opt/local/mysql…
Clickbeetle
  • 629
  • 4
  • 13
1
vote
1 answer

How to create image from transparent image mangles color?

I am building one kind of system, which simply creates dynamic image from other image. I use: imagecreatefromstring(file_get_contents("clown_avatar.png")); to create image and output it successfully; but, it messes all the colors on the transparent…
Martti Laine
  • 12,655
  • 22
  • 68
  • 102
1
vote
0 answers

'erase' part of image created with GD

I am working with PHP 5.3/5.4 and GD. I have used the following code to create an image canvas: $col = imagecreatetruecolor($width, $height); $bg = ImageColorAllocate($col, 42, 208, 77); After I do this, I do some drawing. This all works just…
Lee Loftiss
  • 3,035
  • 7
  • 45
  • 73
1
vote
1 answer

Download GD-JPEG image with correct dimensions from cURL CLI

I need help in downloading a series of GD generated images with their correct dimensions. I'm using this command in the cURL CLI to download a range of items: curl "http://apl-moe-eng-www.ai-mi.jp/img/php/fitsample.php?&i_id=4[0001-9999]" -o…
1
vote
2 answers

PHP GD lib text rendering with pixilation

Here's the problem the text overlayed over the image and gradient has some weird pixilation around the text, but I can't work out why. --> Here's the code:
Gcoop
  • 3,372
  • 4
  • 26
  • 35
1
vote
2 answers

php resize images script

I am using directory iterator to iterate through directories and resize images found in that directory, I am doing this from browser cause I don't have ssh access to that server. Most pictures resize fine but for every 10 pictures (more or less) I…
dfilkovi
  • 3,051
  • 7
  • 39
  • 51
1
vote
0 answers

GD Library - How to use via commandline? Ubuntu 12.10

Is there any way to use GD to convert images via the commandline? I need to do a comparison of output quality between GD and Imagemagick. I've installed php5-gd and libgd-tools but can't seem to find any information on how to run a simple…
waffl
  • 5,179
  • 10
  • 73
  • 123
1
vote
2 answers

How to get a border radius on a rectangle using gd library

I am using gd library code to create a rectangle. How could I get a border radius on my rectangle in php. Here is my code so for: $bg_color="5465FF"; $text_color="61FF66"; $button_width = 150; $button_height =50; $textdisplay="text"; $r_bg =…
Kennedy
  • 325
  • 2
  • 14
  • 35
1
vote
1 answer

PHP Image Interlacing not working with Imagick, why?

I'm trying to finish up my image uploader that utilizes imagick for the handling of various image types. One thing specifically that I'm trying to get working is the conversion of jpeg files to progressive jpeg. I've tried the following code below,…
Braydon Batungbacal
  • 1,028
  • 2
  • 24
  • 52