images2gif.py 文件源码

python
阅读 40 收藏 0 点赞 0 评论 0

项目:CycleGAN-Tensorflow-PyTorch-Simple 作者: LynnHo 项目源码 文件源码
def __init__(self, image, samplefac=10, colors=256):

        # Check Numpy
        if np is None:
            raise RuntimeError("Need Numpy for the NeuQuant algorithm.")

        # Check image
        if image.size[0] * image.size[1] < NeuQuant.MAXPRIME:
            raise IOError("Image is too small")
        if image.mode != "RGBA":
            raise IOError("Image mode should be RGBA.")

        # Initialize
        self.setconstants(samplefac, colors)
        self.pixels = np.fromstring(image.tostring(), np.uint32)
        self.setUpArrays()

        self.learn()
        self.fix()
        self.inxbuild()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号