gd

How can I add an image onto an image in PHP like a watermark

大城市里の小女人 提交于 2020-01-19 15:17:43
问题 I am trying to write a small php function to take an image and apply a watermark type image on top of the image and them save them as 1 image, this code runs with 0 errors but does not apply the watermark image, is there anything obvious that stants out on why it won't? <?PHP $source_file_path ='http://cache2.mycrib.net/images/image_group92/0/43/653807d5727a46498180e8ef57fdf7819b2b0c.jpg'; $watermark_image='fpwatermark.gif'; // the watermark image $destination_image ='coooolgif.gif'; // where

How can I add an image onto an image in PHP like a watermark

独自空忆成欢 提交于 2020-01-19 15:17:32
问题 I am trying to write a small php function to take an image and apply a watermark type image on top of the image and them save them as 1 image, this code runs with 0 errors but does not apply the watermark image, is there anything obvious that stants out on why it won't? <?PHP $source_file_path ='http://cache2.mycrib.net/images/image_group92/0/43/653807d5727a46498180e8ef57fdf7819b2b0c.jpg'; $watermark_image='fpwatermark.gif'; // the watermark image $destination_image ='coooolgif.gif'; // where

Crop image in PHP

守給你的承諾、 提交于 2020-01-18 04:09:05
问题 The code below crops the image well, which is what i want, but for larger images, it wotn work as well. Is there any way of 'zooming out of the image' Idealy i would be able to have each image roughly the same size before cropping so that i would get good results each time Code is <?php $image = $_GET['src']; // the image to crop $dest_image = 'images/cropped_whatever.jpg'; // make sure the directory is writeable $img = imagecreatetruecolor('200','150'); $org_img = imagecreatefromjpeg($image)

php proportionally resize and cut a circle out of a square image

女生的网名这么多〃 提交于 2020-01-16 18:45:12
问题 I have many square images with different sizes, and I want to first resize them so they are inside a 150pixel area (so the images are not distorted, so since most images are not exactly the same size on both height and width one of the sides would be smaller (proportionally). Then once I do that I need to cut a perfect circle out of them and apply a 10pixel colored border. Now how on earth could I even start this? 回答1: Well, you take your files from disk or however and then you use them to

php proportionally resize and cut a circle out of a square image

为君一笑 提交于 2020-01-16 18:45:06
问题 I have many square images with different sizes, and I want to first resize them so they are inside a 150pixel area (so the images are not distorted, so since most images are not exactly the same size on both height and width one of the sides would be smaller (proportionally). Then once I do that I need to cut a perfect circle out of them and apply a 10pixel colored border. Now how on earth could I even start this? 回答1: Well, you take your files from disk or however and then you use them to

imagettftext not working

假如想象 提交于 2020-01-16 03:51:13
问题 I've tried to write text in an image just for testing purposes because my Zabbix install is not writing text in the graphs. I've copied the code bellow from the php.net website (http://php.net/manual/en/function.imagettftext.php) <?php // Set the content-type header('Content-Type: image/png'); // Create the image $im = imagecreatetruecolor(400, 30); // Create some colors $white = imagecolorallocate($im, 255, 255, 255); $grey = imagecolorallocate($im, 128, 128, 128); $black =

create random curve lines in an image for captcha

浪子不回头ぞ 提交于 2020-01-14 19:35:21
问题 I want to create an script for creating captcha images similar to the captcha used by some popular websites like in the image below. I have created the script which generates captcha but I want to make it somewhat like below And I want to add those random lines in the image but I cant figure our how can I achieve it,Please suggest how to do it in PHP.or any similar open-source project I can reference to. 回答1: The below code gives you a starting point to do what you want. Note that this gives

create random curve lines in an image for captcha

天大地大妈咪最大 提交于 2020-01-14 19:35:08
问题 I want to create an script for creating captcha images similar to the captcha used by some popular websites like in the image below. I have created the script which generates captcha but I want to make it somewhat like below And I want to add those random lines in the image but I cant figure our how can I achieve it,Please suggest how to do it in PHP.or any similar open-source project I can reference to. 回答1: The below code gives you a starting point to do what you want. Note that this gives

BiCubic Shaper PHP Image Resize

亡梦爱人 提交于 2020-01-14 11:52:27
问题 Photoshop has that great: BiCube Shaper option for resizing. However I cannot find an equivalent. I've seen various code using GD that used imagecopyresampled and custom unsharp mask, but no where near the quality I am expecting. Any help? 回答1: If all you've tried is GD, you might want to give some of the ImageMagick sampling filters a shot. Here's a page that examines them along with the PhotoShop ones: http://www.xs4all.nl/~bvdwolf/main/foto/down_sample/down_sample.htm 来源: https:/

Creating IMage from Text in PHP - how can I make multiline?

▼魔方 西西 提交于 2020-01-14 08:03:34
问题 I have a script that generates images from text using PHP. It's working fine except that I would like it to generate multiline text as well with differing colors. How can it be done using PHP, GD and Freetype? Below is the code I use to generate single line text images. $textval = 'This is some text to be an image'; $textcolor = '666666'; $font="arial.ttf"; $size = 9; $padding= 1; $bgcolor= "ffffff"; $transparent = 0; $antialias = 0; $fontfile = $fontpath.$font; $box= imageftbbox( $size, 0,