Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

imagecolortransparent(3) [php man page]

IMAGECOLORTRANSPARENT(3)						 1						  IMAGECOLORTRANSPARENT(3)

imagecolortransparent - Define a color as transparent

SYNOPSIS
int imagecolortransparent (resource $image, [int $color]) DESCRIPTION
Sets the transparent color in the given $image. PARAMETERS
o $ image -An image resource, returned by one of the image creation functions, such as imagecreatetruecolor(3). o $color - A color identifier created with imagecolorallocate(3). RETURN VALUES
The identifier of the new (or current, if none is specified) transparent color is returned. If $color is not specified, and the image has no transparent color, the returned identifier will be -1. EXAMPLES
Example #1 imagecolortransparent(3) example <?php // Create a 55x30 image $im = imagecreatetruecolor(55, 30); $red = imagecolorallocate($im, 255, 0, 0); $black = imagecolorallocate($im, 0, 0, 0); // Make the background transparent imagecolortransparent($im, $black); // Draw a red rectangle imagefilledrectangle($im, 4, 4, 50, 25, $red); // Save the image imagepng($im, './imagecolortransparent.png'); imagedestroy($im); ?> The above example will output something similar to:[NOT DISPLAYABLE MEDIA]Output of example : imagecolortransparent() NOTES
Note Transparency is copied only with imagecopymerge(3) and true color images, not with imagecopy(3) or pallete images. Note The transparent color is a property of the image, transparency is not a property of the color. Once you have set a color to be the transparent color, any regions of the image in that color that were drawn previously will be transparent. PHP Documentation Group IMAGECOLORTRANSPARENT(3)

Check Out this Related Man Page

IMAGEFILLEDRECTANGLE(3) 						 1						   IMAGEFILLEDRECTANGLE(3)

imagefilledrectangle - Draw a filled rectangle

SYNOPSIS
bool imagefilledrectangle (resource $image, int $x1, int $y1, int $x2, int $y2, int $color) DESCRIPTION
Creates a rectangle filled with $color in the given $image starting at point 1 and ending at point 2. 0, 0 is the top left corner of the image. PARAMETERS
o $ image -An image resource, returned by one of the image creation functions, such as imagecreatetruecolor(3). o $x1 - x-coordinate for point 1. o $y1 - y-coordinate for point 1. o $x2 - x-coordinate for point 2. o $y2 - y-coordinate for point 2. o $color - The fill color. A color identifier created with imagecolorallocate(3). RETURN VALUES
Returns TRUE on success or FALSE on failure. EXAMPLES
Example #1 imagefilledrectangle(3) usage <?php // Create a 55x30 image $im = imagecreatetruecolor(55, 30); $white = imagecolorallocate($im, 255, 255, 255); // Draw a white rectangle imagefilledrectangle($im, 4, 4, 50, 25, $white); // Save the image imagepng($im, './imagefilledrectangle.png'); imagedestroy($im); ?> The above example will output something similar to:[NOT DISPLAYABLE MEDIA]Output of example : imagefilledrectangle() PHP Documentation Group IMAGEFILLEDRECTANGLE(3)
Man Page

15 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to make my xterm transparent

I just want to make my xterm to be transparent, but I don't know how, could somebody tell me? :( (3 Replies)
Discussion started by: zhiyuan
3 Replies

2. UNIX Desktop Questions & Answers

coverting to xbm

Heleuw, I want to convert an image to .xbm the problem is that, wehen I convert it it is only a 2 color image,(black&white), someknowes a tool or an other solution to get the complete image to .xbm with colors and sizes etc:confused: Thnx in advance EJ =) (2 Replies)
Discussion started by: EJ =)
2 Replies

3. Shell Programming and Scripting

color a figure in text file

Good morning, Can someone help to color a figure in columns if its exceeding a threshold using shell script . ex. I have file contains 5 columns showing a value in % I need to show the value in red if it exceed 90 % Appreciate your help (3 Replies)
Discussion started by: Bluetoot
3 Replies

4. Shell Programming and Scripting

text color

Hi all I have a file contains columns showing figures as below : Input file A B C D 50 60 90 E 100 20 53 F 30 40 70 G 25 27 45 I want to color the value above or equal 90 by red and to be shown as below output file... (5 Replies)
Discussion started by: Bluetoot
5 Replies

5. Linux

Help with color combinations

Hi Team when i do, echo on my host box it returns (see below) # echo $PS1 \$ I need to set a color comination of my own for \u means for user : red for \h means for hostname: blue for \W means present working directory: pink for $ means for wht prompt : yellow Do i need to... (1 Reply)
Discussion started by: whizkidash
1 Replies

6. SuSE

Vi in color

How do you turn off color in vi? (2 Replies)
Discussion started by: jgt
2 Replies

7. Programming

Overlapping pictureboxes?

I am making a game, but I can't figure out how to put one image over the other. The background of the front image, covers up the picturebox under it. For example, I have two fish images, but when one is in front of the other, its background covers up the other fish. I attached a picture as an... (1 Reply)
Discussion started by: romeo5577
1 Replies

8. Red Hat

where can find the good image file of red hat

I have failed many times on install red hat in virtual machine, can anybody provide the good image file of red hat? (3 Replies)
Discussion started by: wulaishiwo
3 Replies

9. UNIX for Dummies Questions & Answers

How do I color some words in output?

OK, let's say if we want to filter lines in man and get a different color for the word we are searching we write man find | grep print It will mark all the words containing print red and output only those lines containing it, let's say I want to see the complete manual, but with marked words... (1 Reply)
Discussion started by: arcelivez
1 Replies

10. Shell Programming and Scripting

zsh, prompt, variable expansion, ANSI color sequences

Hi! I am using latest ZSH and I have setopt prompt_subst I have a global hash array variable which contains some color definitions with color names as keys and 256-color ANSI codes (with %{ and %}) as values, eg %{\ePS1="$FG Hello World (%M) > " or PS1=$'$FG Hello World (%M) > ' then it... (3 Replies)
Discussion started by: galanom
3 Replies

11. UNIX for Dummies Questions & Answers

Formating variables in KSH

Hi Friends , I want to know how to format the output for the following: i searched in the forum and couldnt get the exact requirement. Thanks in advance . (2 Replies)
Discussion started by: i150371485
2 Replies

12. Shell Programming and Scripting

Handle color code

p1=text1 p2=text2(in red color) when i am trying to replace $p1 with $p2, content of the file from text2 become red. so when i open that file using vi its showing color code before tex2. please suggest me how to omit that color code and make content of that file in default color? (1 Reply)
Discussion started by: Biplab
1 Replies

13. Shell Programming and Scripting

Embedding JPEG image to the body file

hi, I am trying to embed an image to the body of the email, but the image is not visible. echo "<html> <body> <style> body {background-color:blue} </style> <h1>hello</h1> <center> <img... (1 Reply)
Discussion started by: ATWC
1 Replies

14. OS X (Apple)

OSX Sierra transparent shell audio sampler.

Well after the transparent QuickTime Player means of capture for OSX 10.7.x became broken in at least Yosemite I decided to persevere with a version of command line capture for OSX 10.12.x. A derivative of this DEMO is now inside AudioScope.sh to give my MBP and iMac a means of capturing an... (3 Replies)
Discussion started by: wisecracker
3 Replies

15. SCO

Acronis true image for UNIXware 7.1.4

Hi, Please can anyone advise if Acronis true image can be used to take a image backup of the disk on sco unixware 7.1.4 and what version of software would I need to use this. The FS are vxfs. Would I need to power off the server before I can use this. Thanks (1 Reply)
Discussion started by: kpnuts
1 Replies