Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

imagecolorstotal(3) [php man page]

IMAGECOLORSTOTAL(3)							 1						       IMAGECOLORSTOTAL(3)

imagecolorstotal - Find out the number of colors in an image's palette

SYNOPSIS
int imagecolorstotal (resource $image) DESCRIPTION
Returns the number of colors in an image palette. PARAMETERS
o $image - An image resource, returned by one of the image creation functions, such as imagecreatefromgif(3). RETURN VALUES
Returns the number of colors in the specified image's palette or 0 for truecolor images. EXAMPLES
Example #1 Getting total number of colors in an image using imagecolorstotal(3) <?php // Create image instance $im = imagecreatefromgif('php.gif'); echo 'Total colors in image: ' . imagecolorstotal($im); // Free image imagedestroy($im); ?> The above example will output something similar to: Total colors in image: 128 SEE ALSO
imagecolorat(3), imagecolorsforindex(3), imageistruecolor(3). PHP Documentation Group IMAGECOLORSTOTAL(3)

Check Out this Related Man Page

IMAGECOLOREXACTALPHA(3) 						 1						   IMAGECOLOREXACTALPHA(3)

imagecolorexactalpha - Get the index of the specified color + alpha

SYNOPSIS
int imagecolorexactalpha (resource $image, int $red, int $green, int $blue, int $alpha) DESCRIPTION
Returns the index of the specified color+alpha in the palette of the image. PARAMETERS
o $ image -An image resource, returned by one of the image creation functions, such as imagecreatetruecolor(3). o $red -Value of red component. o $green -Value of green component. o $blue -Value of blue component. o $alpha - A value between 0 and 127. 0 indicates completely opaque while 127 indicates completely transparent. The colors parameters are integers between 0 and 255 or hexadecimals between 0x00 and 0xFF. RETURN VALUES
Returns the index of the specified color+alpha in the palette of the image, or -1 if the color does not exist in the image's palette. EXAMPLES
Example #1 Get colors from the GD logo <?php // Setup an image $im = imagecreatefrompng('./gdlogo.png'); $colors = Array(); $colors[] = imagecolorexactalpha($im, 255, 0, 0, 0); $colors[] = imagecolorexactalpha($im, 0, 0, 0, 127); $colors[] = imagecolorexactalpha($im, 255, 255, 255, 55); $colors[] = imagecolorexactalpha($im, 100, 255, 52, 20); print_r($colors); // Free from memory imagedestroy($im); ?> The above example will output something similar to: Array ( [0] => 16711680 [1] => 2130706432 [2] => 939524095 [3] => 342163252 ) NOTES
Note This function requires GD 2.0.1 or later (2.0.28 or later is recommended). SEE ALSO
imagecolorclosestalpha(3). PHP Documentation Group IMAGECOLOREXACTALPHA(3)
Man Page

15 More Discussions You Might Find Interesting

1. Windows & DOS: Issues & Discussions

Unix text doc with a .gif image

I would like to insert a .gif image into a text file that is generated by a Unix-based database application. Can anyone please tell me how I can achieve this? (7 Replies)
Discussion started by: sunita_rao
7 Replies

2. UNIX for Advanced & Expert Users

Urgent Awk manipulation query help

Hi UNIX gurus :) , I have the following requirement and not being able to find a solution :( . i have got a file demo.lst movies 10 12 25 songs 11 8 15 DVD 15 12 10 Total 58 60 75 NOTE:-Total value not the sum of the columns but some predefined value. My... (5 Replies)
Discussion started by: rahul26
5 Replies

3. Shell Programming and Scripting

substring

Dear All, i have a file that contains, FROM_DATE: 06-08-2007 00:00:00 TO_DATE: 06-08-2007 23:59:59 Total number of lines: 6874154 in another file,the contain is, FROM_DATE: 06-08-2007 00:00:00 Total number of lines: 874154 alltime i want to find the particular string... (4 Replies)
Discussion started by: panknil
4 Replies

4. Shell Programming and Scripting

I need help with a basic script

a) Total number of words in the file. b) Total number of different words in the file. How can I use the translate and/or unique commands to accomplish this (4 Replies)
Discussion started by: EECSDAVE
4 Replies

5. Post Here to Contact Site Administrators and Moderators

No. post not incrementing

Hi Admin, i just noticed that when I do postings, the number does not increment. eg : Post A -Total Posts 312 Post B - Total Posts 312 Post C - Total Posts 313 Post D - Total Posts 313 Why is this so? Can you kindly check this out? Thank you. (5 Replies)
Discussion started by: incredible
5 Replies

6. Shell Programming and Scripting

New to KSH Scripting > Please Assist!

Array Example: $ colors=RED $ colors=GREEN $ colors=BLUE (4 Replies)
Discussion started by: ora_umair
4 Replies

7. AIX

How do I create a bootable mksysb image file

I have several systems which require software maintenance several times a year. After the software maintenance, it is required that we make two system tapes for DR purposes. The creation of these system tapes takes anywhere from 1-1.5 hours because of the performance of the tape drives. What I... (7 Replies)
Discussion started by: acascianelli
7 Replies

8. Shell Programming and Scripting

How can I add 4 lines together and then read the next 4 lines?

Hi, I have grep:ed on a file with which gives the below output. Total = 43 Total = 21 Total = 23 Total = 2 Total = 3 Total = 1 Total = 0 I would like to add the first 4th lines to a total amount, and do so on for the rest of the lines. I was thinking in terms of using while read.... (32 Replies)
Discussion started by: mr_andrew
32 Replies

9. Shell Programming and Scripting

script needed to merge two files and report differences

Hello, I have two txt files that look like this: db.0.0.0.0: Total number of NS records = 1 db.127.0.0.0: Total number of NS records = 1 Total number of PTR records = 1 db.172.19.0.0: Total number of NS records = 1 Total number of PTR records = 3 db.172.19.59.0: Total... (8 Replies)
Discussion started by: richsark
8 Replies

10. Programming

How to Decode an image using openGL

Hi, How to decode an image using openGL library libjpeg .. which are the steps needed to do this using C language.. actually my work is to decode the image, store it on the buffer, and place it on cube surface.. please guide me,,any answer will appreciated .. (8 Replies)
Discussion started by: Ravikishore
8 Replies

11. UNIX for Dummies Questions & Answers

Download image every 24hrs + put it in php site

Hi everyone, I am all new to this and I might not know what I am asking about :) I have access to a cPanel with cron tab scheduler. I know nothing re scripting creating php etc.. I own a ftp mainly for own email address, some storage, and a forum (ready-made one :P ) I have some knowledge... (5 Replies)
Discussion started by: zYx
5 Replies

12. Red Hat

Create Linux gold image

I 'm new to linux .. can some one tell how can we create a linux image like solaris flash archive and then use it with kickstart server to build multiple clients from same image ? Thanks (4 Replies)
Discussion started by: fugitive
4 Replies

13. Emergency UNIX and Linux Support

T2000 Alom Upgrade

Hi guys! I need to upgrade the fw version of some T2000 servers, but unfortunately the image downloaded from the Oracle does not work...it seems that the image is not supported on the platform.. bash-3.00$ uname -a SunOS adm01 5.10 Generic_141414-07 sun4v sparc SUNW,Sun-Fire-T200... (5 Replies)
Discussion started by: cecco16
5 Replies

14. Solaris

Total

i want to list Total HDD count in any soalris machine..can someone suggest some commands or combinations of commands (6 Replies)
Discussion started by: omkar.jadhav
6 Replies

15. UNIX for Advanced & Expert Users

Installation through mksysb image backup

Hi Experts, I am very new to AIX, I have a mksysb image in one of my aix server (V6), I would like to install this mksysb image on newly lpar. Is it possible without tape and NIM? Advice would be appreciated. Regards, Rockie (11 Replies)
Discussion started by: aix.rockie
11 Replies