Commit 8cc2046c by BellCodeEditor

save project

parent a8392f66
Showing with 19 additions and 12 deletions
P.png

259 KB

a.png

19 KB

from PIL import Image
import numpy as np
img=Image.open("./a.png")
print(img)
value=np.array(img)
print(value)
\ No newline at end of file
File added
"""
请使用turtle模块画出五角星
"""
import turtle
open=turtle.pen()
For i in range(5)
pen.forward(200)
pen.right(144)
pen.hideturtle()
pen.done()
\ No newline at end of file
import wordcloud
from PIL import Image
import numpy
#import jieba
#backgroud_color="white"
img=Image.open("./P.png")
data=numpy.array(img)
img_colors=wordcloud.ImageColorGenerator(data)
w=wordcloud.WordCloud(background_color="red",font_path='a.ttf',mask=data,min_font_size=20,max_font_size=50)
w.generate("你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好")
w.to_file("./a.png")
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment