以下是部分代码预览:
"""
pygame图像处理之温度计图片变成gif动态图,本程序把一张png图片变成gif动态图片
主要原理:通过pygame加载图像,对它进行像素操作,生成一张张的png图片,最后把所有的png图片合成到gif图里。
"""
__author__ = "李兴球"
__date__ = "2019/3/30"
import os
import imageio
import pygame
def makegif_image(path_image,gif_filename):
pass
def draw_rect(left,top,width,height):
pass
if __name__ == "__main__":
source_image = "背景短空-红.png"
dest_image = "风火轮编程_step.gif"
images_path= "images" # 生成的png图片路径
image_width = 87
image_height = 532
start_height = 68
if not os.path.exists(images_path):os.mkdir(images_path)
image = pygame.image.load(source_image)
counter = 0
如需要查看完整代码,请
需要浏览更多吗?
成为会员后,登陆才能继续浏览!联系微信scratch8即可办理会员。
(会员专属:能浏览所有文章,下载所有带链接的Python资源。)

