public function resize($new_width, $new_height)
        {
            $dest = imagecreatetruecolor($new_width, $new_height);

            // Transparency fix contributed by Google Code user 'desfrenes'
            imagealphablending($dest, false);
            imagesavealpha($dest, true);

            if(imagecopyresampled($dest, $this->im, 0, 0, 0, 0, $new_width, $new_height, $this->width, $this->height)) {
                $this->im = $dest;
                $this->width = imagesx($this->im);
                $this->height = imagesy($this->im);
                return true;
            }

            return false;
        }