$white = imagecolorallocate ($im, 255, 255, 255); imagecolordeallocate ($im, $white);
The ImageColorDeAllocate() function de-allocates a color previously allocated with the ImageColorAllocate() function.