'Restores a sample image from given data string which contains
hex-encoded pixels from the top left fourth of a sample.'

def make_sample(self, data, size):

    data = data.replace('    ', '')
    sample = Image.new('L', size)
    s_px = sample.load()
    (w, h) = ((size[0] // 2), (size[1] // 2))
    for y in range(h):
        for x in range(w):
            val = int(data[(((y * w) + x) * 2):((((y * w) + x) + 1) * 2)], 16)
            s_px[(x, y)] = val
            s_px[(((size[0] - x) - 1), ((size[1] - y) - 1))] = val
            s_px[(x, ((size[1] - y) - 1))] = (255 - val)
            s_px[(((size[0] - x) - 1), y)] = (255 - val)
    return sample
