def get_noise_map(cls, versioned_seed: VersionedSeed) -> Dict[Tuple[int, int], int]:
        """Returns a map from (x,y) coordinate to pixel value 0/1, to be used as rawnoise."""
        w, h = cls.SIZE
        version  = versioned_seed.version
        hex_seed = versioned_seed.seed
        checksum = versioned_seed.checksum
        noise_map = {}
        if version == '0':
            random.seed(int(hex_seed, 16))
            for x in range(w):
                for y in range(h):
                    noise_map[(x, y)] = random.randint(0, 1)
        elif version == '1':
            prng_seed = bfh(hex_seed + version + checksum)
            drbg = DRBG(prng_seed)
            num_noise_bytes = 1929  # ~ w*h
            noise_array = bin(int.from_bytes(drbg.generate(num_noise_bytes), 'big'))[2:]
            # there's an approx 1/1024 chance that the generated number is 'too small'
            # and we would get IndexError below. easiest backwards compat fix:
            noise_array += '0' * (w * h - len(noise_array))
            i = 0
            for x in range(w):
                for y in range(h):
                    noise_map[(x, y)] = int(noise_array[i])
                    i += 1
        else:
            raise Exception(f"unexpected revealer version: {version}")
        return noise_map
Returns a map from (x,y) coordinate to pixel value 0/1, to be used as rawnoise.
electrum/plugins/revealer/revealer.py