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
1 answer

Using PHP's GD functions, how can I create an ellipse that is anti-alised and has a transparent background (PNG24 with alpha)?

I'm able to draw a circle on a transparent background, but it's pixelated around the edges. I can also get an anti-aliased circle on a non-transparent background with http://mierendo.com/software/antialiased_arcs/. So, how do I get both?
mager
  • 4,813
  • 8
  • 29
  • 30
1
vote
1 answer

HHVM - imagettftext(): "No such file or directory"

I am trying to deploy an application that works fine on PHP-FPM to HHVM. Nearly everything works except for one thing: the GD Library. GD in general works, but imagettftext() and imagefttext() don't seem to be working. They return this confusing…
Moeflon
  • 23
  • 5
1
vote
1 answer

supported formats in GD to save an image using php

I am working on a script that allow user to convert their images in different formats. now i have images and i want to save this image in multiple formats i.e. png, jpeg, tiff, psd, jpeg2000 and BMP . is this possible in GD if not then what is the…
user3713959
  • 101
  • 1
  • 13
1
vote
0 answers

Center 2 lines of text with GD library

I'm adding a lon string of text onto an image using PHP GD library. The string may be 2 lines long, or 3. The problem is that it's taking the with of the string with a \n linebreak in it, and then centering that, but its not centering line two. It…
st0rk
  • 421
  • 2
  • 5
  • 11
1
vote
1 answer

PHP - filter image to grayscale and save the image file (using GD library)

I am trying to filter/render image to grayscale. But I'm having trouble on saving the output file on directory. Please see my code below: $img_source = '/path/test.jpg'; $img = imagecreatefromjpeg($img_source); $img_height =…
1
vote
1 answer

php imagettftext and specific emoji

I've run into a problem drawing emoji that are under the 'Miscellaneous Symbols And Pictographs' unicode block. Here is an example code:
1
vote
0 answers

How remove white space in the JPG with PHP?

I want crop white spaces and then resize image and save without those. For example http://stacktoheap.com/images/stackoverflow.png This image can be cropped around 50 pixels from top and bottom. Can I do it with PHP?
serezha93
  • 125
  • 1
  • 1
  • 10
1
vote
1 answer

Tell PHP to enable or use GD when running script via cron

I am attempting to run a php script via cron and I'm hitting a brick wall. When I run the php script via the command line as root, everything works correctly. When I run the php script via the command line as the user, everything works…
Scott Hack
  • 33
  • 5
1
vote
2 answers

Ruby Equivalent of the GD Library usage in PHP

I am looking to write an app that overlays images and copy on top of another image. I know in PHP you can use the GD library but for Ruby does anyone have a specific suggestion of a gem that would help with this? I have seen 2 gems already but not…
JustAl
  • 61
  • 2
1
vote
0 answers

Animation of a Roulette Wheel in C

I am attempting to animate a Roulette Wheel (European version) using the GDImage graphics library. The idea being instead of the whole wheel spinning, a chord (integer seg, segPositionAngle etc) runs around the wheel and stops on a random number.…
1
vote
1 answer

Image cropping with PHP (GD)

I have the below image which I'd like to crop, so all the black areas are removed and the thumb returned. The thumb must be 130px (width) by 155px (height). How can I crop it using PHP's GD library? (Imagick library isn't an option). If there is…
W.D.
  • 1,033
  • 1
  • 7
  • 12
1
vote
2 answers

PHP - Black background after resizing transparent png and gif

I am using the below code to resize images. When transparent images, (png/gif) are uploaded the new images created have black background. How can i make the background white after resizing? pls help $info = pathinfo($_FILES['file']['name']); …
Gijo Varghese
  • 11,264
  • 22
  • 73
  • 122
1
vote
2 answers

Is there a way to generate an image based on the user's name like iOS7 Favourites using a web language?

In this screenshot of iOS7 Favourites, when a photo doesn't exist for a particular user, a placeholder image is displayed using the initials of said contact. Is there a way to do this for the web? A service like lorempixel? Or can this be done in a…
Michael
  • 4,282
  • 9
  • 55
  • 89
1
vote
1 answer

Use Perl/GD to create and insert image directly into excel workbook?

I have had no luck figuring out how to insert an image (a gif in this case) created in perl with GD directly into an excel workbook, without first saving the image to a file. Is this possible using win32::OLE or one of the perl spreadsheet…
m2-so
  • 11
  • 1
1
vote
1 answer

php: trying to merge multiple pngs together getting error

Note sure what i am doing wrong here... but im trying to merge 3 pngs over into one and it is throwing an error Warning: imagepng() [function.imagepng]: gd-png error: no colors in palette in C:\wamp\www\jeep\public\test\png_2.php on line 22 $x =…
jason
  • 1,132
  • 14
  • 32