有没有办法在用python中的imageio制作gif的同时压缩它?我制作了大约200张图片的gif,最后的文件是30MB。我更喜欢如果它是5-10MB。无论如何,图像是单色的,所以压缩应该没问题。有没有工具可以让我使用或者在imageio中指定?
下面是我用来制作gif的代码:
import os
import imageio as io
import re
#############################################################
#key to sort the file_names in order
numbers = re.compil
这可能是不恰当的,但我正在制作一个不和谐的机器人,在这个过程中,我想要制作一个"gif“命令。我选择了Giphy api,因为它似乎是最简单的。但每次我要求机器人获取一个流行的gif时,它都会给我相同的gif。(附带示例) Here you can see he bot sending the same gif 2 times 以下是此命令所需的代码: if (message.content.startsWith(`${prefix}gif`)) {
giphy.trending('gifs', {limit:100})
.then((resp
我正在用laravel制作profile图片api,想要更新user表中的配置文件图像,但不插入或更新我的图像,.Belew是我的代码,请帮助我如何更新用户表。
fileUploadController.php
<?php
namespace App\Http\Controllers\API;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\User;
use App\Detail;
use App\Profile;
use Illuminate\Support\Facades\DB;
基本上,我使用下面的代码来制作gif图像,我的图像是透明背景的png,但是gif是黑色背景。我不知道如何使gif具有透明的背景。
#gif writer
with io.get_writer('my.gif', mode='I', duration=0.1) as writer:
for filename in file_names:
image = io.imread(filename)
writer.append_data(image)
#writer.close()
其中filenames是一个数组,其中包含要使用的
我正在制作的AppleScript从gif文件中提取框架,并将各个图像放在应用程序内容中的一个文件夹中。然后,它会迅速将桌面背景更改为文件夹中的图像,从而为壁纸提供一个gif。但是,我不知道如何将gif文件解压缩到应用程序中的文件夹中。到目前为止,这就是我所拥有的:
on delay duration
set endTime to (current date) + duration
repeat while (current date) is less than endTime
tell AppleScript to delay duration
end repeat
end dela