gd

Save DIV content as image

hi i have a div that shows some content (several images, text, floating elements, etc) and i would like to add the posibility to user do something like "Save this content as image" how can i do that? i read all the php doc but there's nothing good to do this, even imagegrabwindow sucks because of its high load, browser limitations and ...

Possible to use PHP GD's imagecreatefromgif() and imagettftext() together?

Basically I am looking for a way to write dynamic text on top of a GIF [preferably via PHP GD.] But I can't seem to get these two functions to play nice. For reference: imagecreatefromgif & imagettftext function load_gif($imgname) { $im = @imagecreatefromgif($imgname); if(!$im) { $im = imagecreatetruecolor(150,30)...

Image upload errors + quality reduction to push upload

Morning all, creating an ajax upload. problem being i want to error out when image is too large. Here's my code PHP Code: <?php if(isset($_FILES) && count($_FILES)!=0) { $directory = "./"; $maxWidth = 2500; if(!file_exists($directory)) { mkdir($directory, 0700); // create directory if not exists } if...

Crop whitespace from image in PHP

Is it possible to remove the whitespace surrounding an image in PHP? NOTE: to clarify I mean something like photoshops trim feature. Thanks. ...

Image size reduction in PHP

In cases such as this error: Fatal error: Out of memory (allocated 31981568) (tried to allocate 3264 bytes) Can I use the GD lib to reduce its file size first before getting to this stage? ...

Should I use ImageMagick or GD2 with ImageAPI in drupal?

Why? What are the pros and cons of each? ...

PHP GD PNG - Transparent text is pretty rigid

I'm using a PHP script that I found a while back that lets you specify text in a GET variable and it will convert it to a transparent PNG. This allows me to use non web safe fonts in my websites without having to manually convert each piece of text to an image. I've run into a slight problem, though, as seen here: http://imagebin.ca/vie...

PHP watermarking

i am using this code to create watermark. $image = '1.jpg'; $overlay = 'stamp.png'; $opacity = "20"; if (!file_exists($image)) { die("Image does not exist."); } // Set offset from bottom-right corner $w_offset = 0; $h_offset = 100; $extension = strtolower(substr($image, strrpos($image, ".") + 1)); // Load image from file ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 pixels how can i do that. any help? ...

Ready solution for manipulate images.

I'm searching for a class or function, to convert, add borders and text (using ttf fonts) to an uploaded image before the image is saved on the server. Do you know something? ...

[PHP] Dynamic GD image width text

I'm trying to spice up my website by using custom fonts for headings. For me, the most appropriate way to do this is using PHP and GD. I have written a little script which will output the dynamic text based on the $_GET value, however sometimes the image is too wide, which moves everything else about. How can I get the image to adjust t...

Using a transparent PNG as a clip mask

Is it possible to take this image: And apply this mask: And turn it into this: Using either GD or Imagick? I know it's possible to mask an image using shapes but I'm not sure how to go on about doing it with a pre-created alphatransparent image. :s ...

Any way to calculate the pixel length of a string?

I'm using the GD library for PHP, and using functions like imagestring() and imagestringup() to add text to pictures. I am using the built-in fonts with latin2 encoding. Is there a way, with a given string, to calculate the length (in pixels) of the string? I want to calculate the length in pixels of the strings because the strings ...

New lines in a string with GD library

Is it possible? \n doesnt work, html doesnt work, nothing seems to work. I know I could just make a new string instead, but that is more effort than should be needed for this simple task. How can I do this? ...

GD PHP dynamic pie chart generation issue

I've created a dynamic pie chart with the GD extension using the image filled arc function. I pass to this script, via HTTP GET variables, up to 11 values. the first value, n, is the number of values that follow. n1,n2,n3, etc. are the data itself. These are integer precentages. The goal is to make a chart that will show the percent...

PHP gdLib 8-Bit PNG with alpha

Hi, how is it possible to save my image, created with gd, as an png-8? it saves as gif with transparent channel well - but I want to use png-8. Best Regards, Beerweasle ...

PHP images add txt

I am trying to get it to show text1 and text2 on the same image only Text1 is showing up $rImg = ImageCreateFromJPEG("test.jpg"); $cor = imagecolorallocate($rImg, 0, 0, 0); imagestring($rImg,5,126,22,"Text1",$cor); imagestring($rImg,5,500,34,"Text2",$cor); header('Content-type: image/jpeg'); imagejpeg($rImg,NULL,100); Thank you ...

php gd: create new image based on combine/join 3 images, and then rotate the new image

Basically I have 3 png images. They have the same height and different width. I want to create a new image on the fly, then join the 3 images (not merging, I want to respect the content of each image) and put them on the new image. After that I wanto to rotate that new image. I want to do it with php GD. If someone can give me an ide...

GD/PHP heatmaps on geographical background

I am trying to reproduce the heatmap effect Bungie uses to show kills/deaths on specific halo 3 maps using PHP and GD. (Example: http://www.bungie.net/stats/halo3/heatmapstats.aspx?player=gatts007 - pick a map like "Guardian" for a better example.) I have all the data and background map images from my game, but I am having trouble comi...

PHP GD Font Width Calculate Help

OK a little background story. I am redesigning one of my old websites and I want to use Myriad Pro for the title on the page. This will be dynamic with PHP, etc. At first I thought I should just use CSS styles and define Myriad as the main font. But after using typetester.org, I found that Myriad and let's say Arial are different height...