Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

imagepalettecopy(3) [php man page]

IMAGEPALETTECOPY(3)							 1						       IMAGEPALETTECOPY(3)

imagepalettecopy - Copy the palette from one image to another

SYNOPSIS
void imagepalettecopy (resource $destination, resource $source) DESCRIPTION
imagepalettecopy(3) copies the palette from the $source image to the $destination image. PARAMETERS
o $destination - The destination image resource. o $source - The source image resource. RETURN VALUES
No value is returned. EXAMPLES
Example #1 imagepalettecopy(3) example <?php // Create two palette images $palette1 = imagecreate(100, 100); $palette2 = imagecreate(100, 100); // Allocate the background to be // green in the first palette image $green = imagecolorallocate($palette1, 0, 255, 0); // Copy the palette from image 1 to image 2 imagepalettecopy($palette2, $palette1); // Since the palette is now copied we can use the // green color allocated to image 1 without using // imagecolorallocate() twice imagefilledrectangle($palette2, 0, 0, 99, 99, $green); // Output image to the browser header('Content-type: image/png'); imagepng($palette2); imagedestroy($palette1); imagedestroy($palette2); ?> PHP Documentation Group IMAGEPALETTECOPY(3)

Check Out this Related Man Page

IMAGETRUECOLORTOPALETTE(3)						 1						IMAGETRUECOLORTOPALETTE(3)

imagetruecolortopalette - Convert a true color image to a palette image

SYNOPSIS
bool imagetruecolortopalette (resource $image, bool $dither, int $ncolors) DESCRIPTION
imagetruecolortopalette(3) converts a truecolor image to a palette image. The code for this function was originally drawn from the Indepen- dent JPEG Group library code, which is excellent. The code has been modified to preserve as much alpha channel information as possible in the resulting palette, in addition to preserving colors as well as possible. This does not work as well as might be hoped. It is usually best to simply produce a truecolor output image instead, which guarantees the highest output quality. PARAMETERS
o $ image -An image resource, returned by one of the image creation functions, such as imagecreatetruecolor(3). o $dither - Indicates if the image should be dithered - if it is TRUE then dithering will be used which will result in a more speckled image but with better color approximation. o $ncolors - Sets the maximum number of colors that should be retained in the palette. RETURN VALUES
Returns TRUE on success or FALSE on failure. EXAMPLES
Example #1 Converting a true color image to a palette-based image <?php // Create a new true color image $im = imagecreatetruecolor(100, 100); // Convert to palette-based with no dithering and 255 colors imagetruecolortopalette($im, false, 255); // Save the image imagepng($im, './paletteimage.png'); imagedestroy($im); ?> NOTES
Note This function requires GD 2.0.1 or later (2.0.28 or later is recommended). PHP Documentation Group IMAGETRUECOLORTOPALETTE(3)
Man Page

5 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

oops! Style Manager

Solaris 2.6, using CDE: agh. I accidentally set an ugly palette as my Home Session. The problem is, when I change the palette back to Default, I am informed that my change will be apparent in my next session. But when I log out and in, it's still the Ugly Palette. Doesn't matter if I set the... (1 Reply)
Discussion started by: kristy
1 Replies

2. Post Here to Contact Site Administrators and Moderators

Unable to open uploaded image

Hi, I am unable to view/open the image I uploded in one of the forums. https://www.unix.com/showthread.php?t=37793&page=2&pp=20 Please help. enc. (2 Replies)
Discussion started by: encrypted
2 Replies

3. AIX

mksysb file image

Hello, I have an mksysb image in my disk, created like: # mksysb -i /mnt/backup/lpar2.image I want to know if this image could be copied to a tape and make it a boot image. Thanks Enzote (3 Replies)
Discussion started by: enzote
3 Replies

4. AIX

mksysb installation(clone) on a different server

if VG_SOURCE_DISK_LIST varaible(value set to = hdisk1 hdisk0 )is set in image.data file when taking mksysb image backup on a source server and if we use this image to install it on a different server(clone). Does it warn during installation on the target server if it doesn't have disks hdisk1 and... (1 Reply)
Discussion started by: saikiran_1984
1 Replies

5. Solaris

Copy image on Server-1 and Restores image on Server-2

Hi, I have done Copy image and Restores back on Windows. I have two solaris servers, one contains Solaris OS and Applications on Server-1. Want i required is want to copy image of Server-1 and restores the copied image on Server-2. First of all, is it possibile in Solaris. If it is then... (4 Replies)
Discussion started by: sarshads
4 Replies