当前位置: 首页 > news >正文

网站内容管理系统aso是什么意思

网站内容管理系统,aso是什么意思,wordpress 小米模板,潍坊建站模板搭建生成文件的3d图,例子: 文字: 隐藏图: 使用建议: 1、建议不用中文,因为中文太复杂,生成立体图效果不好。 2、需要指定FONT_PATH,为一个ttf文件,…

生成文件的3d图,例子:
文字:
在这里插入图片描述
隐藏图:
在这里插入图片描述

使用建议:
1、建议不用中文,因为中文太复杂,生成立体图效果不好。
2、需要指定FONT_PATH,为一个ttf文件,linux在/usr/share/fonts目录下,windows在C:\Windows\Fonts
3、建议字体TEXT_SIZE调大,不然不好分辨
4、指定的TEXT不要太长
5、多试几次,找到合适的纹理

from PIL import Image, ImageDraw, ImageFont
from random import *
import numpy as np
from io import BytesIOFONT_PATH = '/usr/share/fonts/dejavu/DejaVuSans.ttf'   # 字体位置,linux在/usr/share/fonts/,windows
TEXT = 'love yannis'
TEXT_SIZE = 100 # 字体大小
WIDTH = 100 + int(len(TEXT) * TEXT_SIZE / 1.8)
HEIGHT = 256
SHIFT = 4 # 叠加位移# 生成纹理
def clamp(n, smallest, largest):return max(smallest, min(n, largest))def rand_ratio(base=1, delta=1):return delta * randint(1,100)*1.0/100 + baserand_ratios = [rand_ratio(), rand_ratio(), rand_ratio()]color_starts = [randint(0,200), randint(0,200), randint(0,200)]def rand_color(i):return clamp(randint(color_starts[i],int(rand_ratios[i] * color_starts[i])), 0, 255) def rand_colors():return (rand_color(0),rand_color(1),rand_color(2))perodic_x = 40
perodic_y = 40
texture = np.zeros((perodic_x, perodic_y, 3))
same_to_last_x = [False] * perodic_x
same_to_last_y = [False] * perodic_y
for x in range(0, perodic_x):same_to_last_x[x] =  random() < 0.1
for y in range(0, perodic_y):same_to_last_y[y] =  random() < 0.3texture[0][0] = rand_colors()for x in range(0,perodic_x):if same_to_last_x[x]:texture[x][0] = texture[x-1][0]else:texture[x][0] = rand_colors()# 纹理平铺
for x in range(0, perodic_x):for y in range(0,perodic_y):if same_to_last_y[y]:texture[x][y] = texture[x][y-1]elif same_to_last_x[x]:texture[x][y] = texture[x-1][y]else:texture[x][y] = rand_colors()# 生成纹理平铺图片
img = Image.new('RGB', (WIDTH, HEIGHT), color = 'white')
img_draw = ImageDraw.Draw(img) 
for x in range(0, WIDTH):for y in range(0,HEIGHT):color = texture[x % perodic_x][y % perodic_y].astype(int).tolist()img_draw.point([x,y], fill = tuple(color))# 生成文字
text = Image.new('RGB', (WIDTH, HEIGHT), color = 'black')
text_draw = ImageDraw.Draw(text) 
font = ImageFont.truetype(FONT_PATH, size=TEXT_SIZE)
text_draw.text((50,(HEIGHT-TEXT_SIZE)/2), TEXT, font=font, fill='white')# 文字叠加
img_mat = np.asarray(img)
text_mat = np.asarray(text)for x in range(0, WIDTH - SHIFT):for y in range(0, HEIGHT):if text_mat[y][x][0] != 0:img_draw.point([x,y], fill = tuple(img_mat[y, x - SHIFT].tolist()))
text.save('../tmp2.png', 'png')
img.save('../tmp.png', 'png')
http://www.hkea.cn/news/728398/

相关文章:

  • 哪个网站教做公众号甘肃百度推广电话
  • 网站怎么让百度收录广告网络推广
  • 小型网站设计及建设论文定制网站制作公司
  • 视频网站建设费用排名优化网站seo排名
  • 怎么自己做网站服务器linux百度账号查询
  • 梧州网站推广方案百度热搜 百度指数
  • 网站不兼容ie6自助建站模板
  • 甘肃网站建设公司百中搜优化软件
  • 国内外贸网站建设公司seo教程 百度网盘
  • 一物一码二维码生成系统最好用的系统优化软件
  • 如何在大网站做外链镇江网站建站
  • 杭州网站建设公司导航短视频营销案例
  • 昆明做网站建设有哪些长尾关键词排名工具
  • 一女被多男做的视频网站网站seo系统
  • 网站建设 青海网站建设找哪家好
  • win7 网站配置优化方案官网电子版
  • 广州seo优化公司排名浙江seo博客
  • 全网推广的方式有哪些抖音seo推荐算法
  • 网站开发开源架构抖音营销软件
  • 自己做的网站能放到网上么青岛seo经理
  • 营业推广策划方案邵阳网站seo
  • 手机网站横向切换kol合作推广
  • 专门做超市海报的网站宁波seo咨询
  • 仿网站上的焦点图在线看seo网站
  • 做网站的业务员艾滋病阻断药有哪些
  • web集团网站建设广告投放平台有哪些
  • 大连做网站建设广告资源对接平台
  • 做网站怎么写工作日志泉州网站seo公司
  • wordpress外链站内打开搜索引擎是什么意思啊
  • 做论坛网站需要什么备案新站seo优化快速上排名