Commit ce011aa2 by BellCodeEditor

save project

parent f3c14fc5
Showing with 20 additions and 4 deletions
from PIL import Image
import numpy as np
img = Image.open("6x2.png")
print(img)
value = np.array(img)
print(value)
\ No newline at end of file
import wordcloud import wordcloud
from PIL import Image
import numpy
with open('python二级考试大纲.txt',encoding='utf-8')as f:
text =f.read()
w = wordcloud.WordCloud(background_color="blue",font_path="SIMKAI.TTF") img = Image.open("alice.png")
w.generate("无毒无害读完后") data = numpy.array(img)
w.to_file("bell.png") img_colors = wordcloud.ImageColorGenerator(data)
\ No newline at end of file w = wordcloud.WordCloud(background_color="white",font_path="SIMKAI.TTF",mask=data,color_func=img_colors)
w.generate(text)
w.to_file("mycloud.png")
\ No newline at end of file

9.94 KB | W: | H:

159 KB | W: | H:

mycloud.png
mycloud.png
mycloud.png
mycloud.png
  • 2-up
  • Swipe
  • Onion skin
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