院徽手绘效果图
Posted chenzhijie
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了院徽手绘效果图相关的知识,希望对你有一定的参考价值。
from PIL import Image import numpy as np a = np.asarray(Image.open(r‘C:UsersAdministratorPictures院徽.jpg‘).convert(‘L‘)).astype(‘float‘) depth = 10. # (0-100) grad = np.gradient(a) grad_x, grad_y = grad grad_x = grad_x*depth/100. grad_y = grad_y*depth/100. A = np.sqrt(grad_x**2 + grad_y**2 + 1.) uni_x = grad_x/A uni_y = grad_y/A uni_z = 1./A vec_el = np.pi/2.2 vec_az = np.pi/4. dx = np.cos(vec_el)*np.cos(vec_az) dy = np.cos(vec_el)*np.sin(vec_az) dz = np.sin(vec_el) b = 255*(dx*uni_x + dy*uni_y + dz*uni_z) b = b.clip(0,255) im = Image.fromarray(b.astype(‘uint8‘)) im.save(r‘C:UsersAdministratorPictures院徽手绘.jpg‘)
绘图前:
效果图:
以上是关于院徽手绘效果图的主要内容,如果未能解决你的问题,请参考以下文章