Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
level3-lesson22-diy3-1
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
e204b694
authored
Oct 28, 2023
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
98c77c2a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
0 deletions
f.py
g.py
f.py
0 → 100644
View file @
e204b694
import
imageio
def
create_gif
(
image_list
,
gif_name
,
duration
=
1.0
):
'''
:param image_list: 这个列表用于存放生物动图的图片
:param gif_name: 字符串,所生成gif文件名,带。gif后缓
:param duration: 图像间隔时间
:return:
'''
frames
=
[]
for
image_name
in
image_list
:
frames
.
append
(
imageio
.
imread
(
image_name
))
imageio
.
mimsave
(
gif_name
,
frames
,
'GIF'
,
duration
=
duration
)
return
def
main
():
image_list
=
[
'1,jpg'
,
'2.jpg''3jpg]
gif_name = '
new
.
gif
'
duration = 1.5
create_gif(image_list,gif_name,duration)
if __name__ == '
__main__
':
main()
\ No newline at end of file
g.py
0 → 100644
View file @
e204b694
from
tkinter
import
filedialog
,
Tk
from
PIL
import
Image
root
=
Tk
()
root
.
withdraw
()
path
=
filedialog
.
askopenfilenames
(
title
=
'选择图片文件'
,
filetypes
=
[(
'peg'
,
'.peg'
)],
initialdir
=
"./"
)
img_list
=
[]
for
i
in
path
:
img
=
image
.
open
(
1
)
img_list
.
insert
(
img
)
img_list
[
0
]
.
save
(
"bot.gif"
,
save_all
=
True
,
append_images
=
img_list
[
1
:])
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment