private function buildFrame(Frame $frame)
    {
        // graphics control extensions
        $encoded = $this->buildGraphicsControlExtension($frame);

        // image descriptor
        $encoded .= $this->buildImageDescriptor($frame);

        // add image data
        $encoded .= $frame->getImageData();

        return $encoded;
    }