IMAGECOLORRESOLVE(3) 1 IMAGECOLORRESOLVE(3)imagecolorresolve - Get the index of the specified color or its closest possible alternativeSYNOPSIS
int imagecolorresolve (resource $image, int $red, int $green, int $blue)
DESCRIPTION
This function is guaranteed to return a color index for a requested color, either the exact color or the closest possible alternative.
If you created the image from a file, only colors used in the image are resolved. Colors present only in the palette are not resolved.
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.
RETURN VALUES
Returns a color index.
EXAMPLES
Example #1
Using imagecoloresolve(3) to get colors from an image
<?php
// Load an image
$im = imagecreatefromgif('phplogo.gif');
// Get closest colors from the image
$colors = array();
$colors[] = imagecolorresolve($im, 255, 255, 255);
$colors[] = imagecolorresolve($im, 0, 0, 200);
// Output
print_r($colors);
imagedestroy($im);
?>
The above example will output something similar to:
Array
(
[0] => 89
[1] => 85
)
SEE ALSO imagecolorclosest(3).
PHP Documentation Group IMAGECOLORRESOLVE(3)
Check Out this Related Man Page
IMAGECOLORCLOSESTHWB(3) 1 IMAGECOLORCLOSESTHWB(3)imagecolorclosesthwb - Get the index of the color which has the hue, white and blacknessSYNOPSIS
int imagecolorclosesthwb (resource $image, int $red, int $green, int $blue)
DESCRIPTION
Get the index of the color which has the hue, white and blackness nearest the given color.
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.
RETURN VALUES
Returns an integer with the index of the color which has the hue, white and blackness nearest the given color.
EXAMPLES
Example #1
Example of using imagecolorclosesthwb(3)
<?php
$im = imagecreatefromgif('php.gif');
echo 'HWB: ' . imagecolorclosesthwb($im, 116, 115, 152);
imagedestroy($im);
?>
The above example will output something similar to:
HWB: 33
CHANGELOG
+--------+--------------------------------------------+
|Version | |
| | |
| | Description |
| | |
+--------+--------------------------------------------+
| 5.3.0 | |
| | |
| | This function is now available on Windows |
| | |
+--------+--------------------------------------------+
SEE ALSO imagecolorclosest(3).
PHP Documentation Group IMAGECOLORCLOSESTHWB(3)
I want to turn off all colors schemes when I log onto my RedHat system. I have copied the dir_colors file to my home directory and modified that to turn colors off but it doesnt appear to be working.(sourced the file from within my .profile). Also, I do not want the colors in my vi sessions... (2 Replies)
Hi All,
is it poosible to Print the error messages in colors.., i am using KSH...,
i have tried the following,
echo "\033 Hi This is Sam!!!
But, when i tried to redirect in to a log file, i am getting as follows,
echo "\033 1 line, 31 characters
^[[34m Hi This is Sikki!!! ^[[0m
... (0 Replies)
I have been trying to get the output of an ssh session pushed to file... the problem is that there are colors in the output, and when I view the file the colors show up as "^[00m" or other such various nonsense
The weird part is that if I do this all manually, I have no problems, but if I try to... (0 Replies)
This is the error that I am getting while retrieving image from image server using system imager....
Listening on LPF/lo/<null>
sending on Socket/fallback/fallback-net
DHCPDISCOVER on lo to 255.255.255.255 port 67 interval 5
DHCPDISCOVER on lo to 255.255.255.255 port 67 interval5... (1 Reply)
Hi,
i would like to change color depending from the valuerange.
a gnuplot-script will generate a multiplot and in one graph,
the ranges should have different colors, e.g.
100 ... 133 --> red
200 ... 233 --> blue
300 ... 333 --> orange
400 ... 433 --> green
#Partikeldata - Partikel... (1 Reply)
Hello, I am having an issue with ANSI colors in Redhat linux.
I am running a script where the colours have been set very early on as follows:
# Reset
Color_Off='\033
Later in the script these are used to color define sections of output by reffering to them using:
${White} blah blah blah... (4 Replies)
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)