Transparent GD Watermark.
Any one know what would be the best way to accomplish a transparent watermark on upload with GD that will work for Jpegs, Gifs and Pngs, using only GD in php 4?
View Complete Forum Thread with Replies
Related Forum Messages:
Transparent Overlay Watermark - On The Fly?
Is it possible to overlay a transparent watermark on an image - dynamically? I'd like the result to look like this example: <http://www.cycletourist.com/temp/photo.php> That is a bit of overkill, but you can see what I mean. The watermark image (a png image) is included separately below the photo. I tried using a class from phpclasses.org <http://www.phpclasses.org/browse/package/1580.html... but the result looks horrible. The transparency does not work. I found one other method through Google, <http://www.sitepoint.com/article/watermark-images-php> but it did not work, either. Can this kind of transparent overlay be done on the fly with GD lib?
View Replies !
PHP (GD) Created Transparent PNG: AlphaImageLoader Makes Black Parts Transparent Instead Of Transparent Color Set With PHP
I have a problem with PHP (GD) created transparent PNG and Microsofts AlphaImageLoader. You will immediately see what the problem is if you view http://www.useful-scripts.biz/test/.../transpng_2.php with IE 7 or Firefox and then with IE 6. It seems that the AlphaImageLoader works correctly on a PNG image that has been created with an image processor and then uploaded, but not with a PNG image created with PHP. It seems to ignore the transparent color set with PHP and instead to render the black color transparent. The image in question was created using this code: <?php $source = imagecreatefrompng("parrot_orig.png"); $transp = imagecolorallocate($source,255,0,0); imagecolortransparent($source,$transp); imagefilledrectangle($source,15,15,70,70,$transp); imagepng($source,"parrot_php.png"); ?> The HTML used on the page is this:
View Replies !
Watermark.
I'm trying to place one image on top of another with transparency so it is a watermark. I'm using Red Hat Linux 7.3. PHP 4.3.2, and GD 2.0.12 compatible.
View Replies !
Watermark On .jpg, .gif, .png
I want to add the watermark on the all types of images like .jpg, .gif (animated gif), .png etc while user uploads the photo. Does anyone have script that works for all types of images? The image size is not fixed. So I need to consider that too.
View Replies !
Transparent GIF
I am trying to resize transparent GIF images, so I was reading, and they say to use fopen, fread, and read the first 13 bytes... OK, so I read in a transparent gif, and the first 13 bytes... and echo it out to the screen, and I get this: GIF89a›�s�÷��What am I supposed to do with that? they then say "allocate that color as transparent, and use imagecopy(); to set the transparency back."
View Replies !
Transparent .png
This isn't totally related to php, but I am using a php generated page that is using transparent .png's. Anyway, when I view the page in Internet Explorer, the transparency within the png is replaced with grey?? But when I view it in Firefox it works fine?
View Replies !
Watermark On Picture
I currently have this code which works and adds text on top of the pictures when they are generated. However it is hard to read and the color is not the same on all of them. How could I make a small black box to go behind the text? PHP Code:
View Replies !
Watermark Images
I'd like to watermark the images that get uploaded! I've tried a few things but no luck, closest I got was it uploading just a black image at the right dimensions? The original upload script is below, Code:
View Replies !
Image Watermark
Bearing in mind I don't have any knowledge or experience with GD, please could somebody give me a simple walkthrough on how to dynamically apply some watermark text to the photos displayed on my site.
View Replies !
Watermark Placement Using GD
I'm trying to place my text in the center of an image using imagettftext(). I've been searching around but can't seem to find anything on text only on images which aren't helping. imagettftext() returns an array with 8 elements making up the location of the text's bounding box. But this confuses me cause i have to use imagettftext to write on the image.. Getting the size of the bounding box afterwards isn't much help really? So yeah can anyone help with the theory of this? My guess would be that i have to figure out the size of the text first.. Then work out where it should be placed on the image. And then use imagettftext with the co-ords I find. Code:
View Replies !
Watermark Border
My site takes in a photo and currently adds a watermark to the bottom right as shown by the code at the bottom of this message. Instead i would like to take in an image like this: and turn it into a pic like this how could this be done? i guess the logical way to do it would be to create another image +40px on both height and width and then apply the original image to the centre of the new image. I would then need to get the border going around the outside in some sort of fasion. Code:
View Replies !
Adding The Watermark
I'm trying to read a directory, for each image, resize it, then add a watermark to it and then delete the original. It's not adding the watermark, and it's making an image inside an image.. Code:
View Replies !
Photos Watermark!!!
I have a web site for photos albums, and i want people who's not registered, to view the pictures with watermakr on it, like the site name or something.
View Replies !
Transparent Image
Hi! Here's a piece of code: [begin] <?php Header('Content-type: image/png'); $sz = ""; $FileValue = 1000; $i = strlen($FileValue); for ( $j = 0; $j < 7-$i; $j++ ) { $sz = $sz . "0"; } $Img = imagecreate(56,13); $Gold = imagecolorallocate($Img,148,128,100); $Gray = imagecolorallocate($Img,32,32,32); ImageFilledRectangle($Img,0,0,55,12,$Gray); imagestring($Img,4,0,0,$sz.$FileValue,$Gold); imagepng($Img); ImageDestroy($Img); ?> [end] OK. Calling this script I have a png picture back. Now I add imagecolortransparent($Img,$Gray); just before imagepng() and OK again, I have a transparent picture back. But now, if I add: $r = imagerotate($Img,90,0); imagepng($r); just after the imagecolortransparent() instruction seen above, I get a rotated picture, but not transparent. How to solve that? I've used a plenty of tricks, no one works.
View Replies !
Resize Transparent PNG
I have a basic script to resize a transparent png image. Code: $dimg = imagecreatetruecolor($newwidth, $newheight); imagecolortransparent($dimg, imagecolorallocate($dimg,0,0,0)); imagealphablending($dimg, false); imagecopyresampled($dimg, $simg, 0, 0, 0, 0, $newwidth, $newheight, $currwidth, $currheight); Problem is that my nice drop shadows are lost in resize. Does anyone know how I can keep them ?
View Replies !
Transparent Background
i'll try to explain myself the best i can, here is the problem: i have a html page and inside this i want to put an iframe that contains a php page. That's ok, i can do it and it works, but the problem is that i can't make that php document to have transparent background. it turns white. Is it because of the iframe? the php document has transparent background, but when i see it inside the iframe it doesn't work.
View Replies !
Two Transparent Colours
I have an image that I am opening and then merging onto another image, and it has two colours which I wish to make transparent, but it is not working, can you please give me an example of how to do this thanks. When I say that it is not working, I mean that when I allocate the second one, the first one is no longer transparent.
View Replies !
Watermark On All Images In A Folder
i m using this script for putting watermark on all images in a folder, but it is not putting watermark.I entered modify.php(name of this script file) so that it could add watermark, but it is not doing its job. I m attaching whole zip file of the script. Code:
View Replies !
Upload > Watermark > Thumbnail
I want to add a upload form in that entry what will upload an image (while or before insert filename[example: dog.jpg] in database), add a watermark and put that in a folder (say... /anime/images) and then create a thumbnail of that image into another folder (say.. anime/images/tn_images). I don't know anything about GD.
View Replies !
Scale Watermark To Image?
I've been watermarking some of my images with a logo but when the images are small it looks bad with a huge logo on it. Does anyone have some code to scale the watermark logo in proportion to the image? Say I always want it logo to be 10% of the width or something.
View Replies !
Php Watermark Script With Embossed Look
I needed your help in writing a function to watermark image. The watermark on the image should be filled with the background image colors and should be slighlty embossed. I am attaching the sample image which I found on the web with a similar watermark. If anybody can help me, it would make my living.
View Replies !
Upload > Watermark > Thumbnail
I have created a form that will add an entry. I want to add a upload form in that entry what will upload an image (while or before insert filename[example: dog.jpg] in database), add a watermark and put that in a folder (say... /anime/images) and then create a thumbnail of that image into another folder (say.. anime/images/tn_images). I don't know anything about GD. what I'm asking is a referral to a site tutorial or reply on how to do this?
View Replies !
Watermark - Image Quality
Dynamically added a watermark from a font. Works fine but the image quality isn't so good. Code: $image = imagecreatefromjpeg("pics/$dir/$filename"); $color = ImageColorAllocate($image, 30, 10, 195); ImageTTFText ($image, 13, 0, 5, 16, $color, "fbsbltc.ttf", "DJBryson.com"); imagejpeg($image); imagedestroy($image);
View Replies !
Smoother Watermark On Images, How ?
I am trying to put watermarks on images on-the-fly by a php script, in general this is done by merging two images , the source and a watermark (usually PNG with transparency). The problem is ... I cannot get the right combination (jpg/png, 8/16 bits, indexed color/RGB color) in order for the watermark to appear with smooth edges over the source image, the watermark always appears eider with white opaque background or when it is transparent it has rough edges.
View Replies !
Text Watermark On Image Reg.
Im trying to use text watermark on images using GD functions. I went through a couple of watermarking threads here, but those were mostly like watermarking images on another image. And only one instance of watermarking is done. I'd like to use text for watermarking. I can set the size & transparency of the text & write to the image directly. Im thinking of using imagettftext function. But this doesnt have transparency as parameter. Any other function would do that? Or is it better to convert text to image & then watermark it using transparency? Code:
View Replies !
Dynamically Transparent Gif's
Basically what i would like to do is dynamically set the transparency of a selection of images (GIF'S) depending on variables set in a My SQL Database. What i need to do is tint some jpg,s by setting the transparency of a solid blue gif which is set over the top of it in a table.
View Replies !
Imagegettftext Transparent Holes
I created an image, made it transparent, drew a rounded rectangle on it and then wrote on it with imagegettftext - where the text is there are transparent holes. $image = imageCreateTrueColor($width,$height); imageSaveAlpha($image, true); ImageAlphaBlending($image, false); $transparentColor = imagecolorallocatealpha($image, 255-$r, 255-$g, 255-$b, 127); imagefill($image, 0, 0, $transparentColor); $background = imagecolorallocate($image, $br, $bg, $bb); .......
View Replies !
Define The Transparent Color
I've made a script that takes images (in gif,jpg & png) and makes their thumbs in jpg format. Now, the problem is if I have a transparent gif when saved to jpg the part of the original picture that is transparent turns black in the new thumb. My question is: how can I define that the transparent part gets the color i want it to get (white is what i need) ? Actually, I now what in theory should be done. I should change the r,g,b values of the color that has aplha=127 (and that's not a problem with imagecolorset()), but also I should change the alpha of that color to 0. how can that be done ? My quess is that that is the right way to do it.
View Replies !
Transparent Watermarks On Images
I'm using the code below to make a watermark and it's kinda working, but I want it semi-transparent as the PNG file is itself. Is there an easy way of overlaying transparent images in the GD library, so that the original image is merged in such as way that it can be seen through the watermark? Code:
View Replies !
Make Thumbnail Transparent
I have a script that will upload an image, then create a thumbnail of that image. When I upload an image with a transparent background the normal sized image comes out with a transparent background, but the thumbnail image comes out with a black background. Code:
View Replies !
Transparent Text On Image?
Is it possible to place transparent text on an image? I want to display an image of some text in a fancy typeface, but superimpose text in a plain style, so that it can be copied and pasted; a bit like what you see in some PDF files, where the page image is visiable, the overlying text is not.
View Replies !
Transparent Filled Polygon
I'm working on a map program where each building is clickable and when it's clicked the page is refreshed to show a map with the building highlighted (in red). I was wondering if it would be possible to highlight the buildings using some sort of combination of the imagepolygonfill function and a transparency function (i'd like the buildings to still be visible under the highlight), rather than having to create many different files with the different buildings highlighted.
View Replies !
Make A Colour Transparent
I would like to do is grab an image, determine what colour is at a certain pixel (maybe 10, 10) and then set that colour to transparent for the whole image. Basically it is so that I can dynamically place an image on various backgrounds for previewing. I am not worried about perfection (anit-aliasing, matte, etc).
View Replies !
Image Thumbnail/Watermark Broken In PHP 4.3.2
The server I was hosting my site on (for free so I can't complain too much) crashed and the administrators migrated to a new server. PHP 4.3.2 is on the new server (can't remember what was on the old). I have the following script which thumbnails and/or watermarks an image and outputs it back to the browser: Code:
View Replies !
Automatic Watermark Generator Onto Images
I dont know if this is posted into the right forum (apologies if not, but I have no idea what it would come under or quite what is involved in the process needed to do this). Basically im building a content managment system in PHP which will upload some images to the database. What I need is some sort of programme that will automatically add a watermark into one of the corners of the image (the logo of the company). This is done on ebay, a small camera icon is inserted into the corner for example. Can someone point me in the right direction because I have no idea how or what is involved or even if its possible.
View Replies !
.htaccess Transparent SESHID And Sessions
just putting the finishing touches on a shopping site and have run into errors in the process when users are blocking cookies. i am using: <IfModule mod_php4.c> php_value session.use_trans_sid 0 </IfModule> in my .htacess file to supress the PHPSESSID=22y3213etc. but it means that if a cookie isn't set the site fails to work properly. if i remove that from my .htaccess the site works fine because the PHPSESSID is passed around evey page, but it knackers things for SEO purposes. Code:
View Replies !
GIF Resize Resample Transparent Fill
I am currently trying to create what I would think is simple. I want to create a image.php file and have it resize a 80 x 80 image to 29 x 29 with out losing the quality. When I try to have the gif image imagefill with the color white (255,255,255) it holds up and ends with a timeout. The gif images also have the black pixels if i don't try filling. Does anyone know a simple script to just resize a gif/jpg file? All documentation has been pretty bad so this is first time posting.
View Replies !
Create Or Resize Transparent .png - Drop Shadow - GD IM
I've searched and d/l'd but cant seem to find a way of creating a semi-transparent drop shadow for an image. Let me say, be fore I go on, I *do not* want one of those scripts that resizes your image a bit to the left and bottom, and then grafts a shadow onto it. I want to use a full shadow (it would be about as big as the image) and shift it a bit with CSS. So, I will have the image sitting in a DIV which will have the shadow as a bg. This works fine doing it manually. So, I would like to find one of two alternatives: 1. (best) Create the shadow from given parameters(size, darkness, spread, etc.) I will write the .png to a folder, I dont really need to create it dynamically each time, but want the ability for the future (galleries) and for when I'm in development and images are changing, moving around, etc. 2. (will work) Take a pre-existing shadow and resize it as needed, but has to keep the transparency.
View Replies !
How Do I Echo A Binary Array (transparent Pixel)
What am I doing wrong here? I want to display a transparent pixel... <? $transparent1x1 = array (71, 73, 70, 56, 57, 97, 1, 0, 1, 0, -128, 0, 0, 0, 0, 0, 0, 0, 0, 33, -7, 4, 1, 0, 0, 0, 0, 44, 0, 0, 0, 0, 1, 0, 1, 0, 0, 2, 2, 68, 1, 0, 59); header("Content-type: " . image_type_to_mime_type (IMAGETYPE_GIF)); echo $transparent1x1; ?>
View Replies !
|