public function setResource( $resource )
	{
		if( !is_resource( $resource ) )
			throw new InvalidArgumentException( 'Must be a valid image resource' );
		if( $this->resource )
			imagedestroy( $this->resource );

		$this->resource	= $resource;
		$this->width	= imagesx( $resource );
		$this->height	= imagesy( $resource );

		if( function_exists( 'imageantialias' ) )
			imageantialias( $this->resource, TRUE );

		imagealphablending( $this->resource, FALSE );											//  disable alpha blending in favour to
		imagesavealpha( $this->resource, TRUE );											//  copying the complete alpha channel
	}