import numpy as np
from PIL import Image



a = np.array(Image.open('Old_Xing.jpg').convert('L')).astype('float')

depth = 10.
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('hand_print_Old_Xing.jpg')

8f0e33f7b1100aad10bb3aa293f60ef61d87b814
<mask token>

<mask token>
im.save('hand_print_Old_Xing.jpg')

<mask token>
a = np.array(Image.open('Old_Xing.jpg').convert('L')).astype('float')
depth = 10.0
grad = np.gradient(a)
grad_x, grad_y = grad
grad_x = grad_x * depth / 100.0
grad_y = grad_y * depth / 100.0
A = np.sqrt(grad_x ** 2 + grad_y ** 2 + 1.0)
uni_x = grad_x / A
uni_y = grad_y / A
uni_z = 1.0 / A
vec_el = np.pi / 2.2
vec_az = np.pi / 4.0
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('hand_print_Old_Xing.jpg')

import numpy as np
from PIL import Image
a = np.array(Image.open('Old_Xing.jpg').convert('L')).astype('float')
depth = 10.0
grad = np.gradient(a)
grad_x, grad_y = grad
grad_x = grad_x * depth / 100.0
grad_y = grad_y * depth / 100.0
A = np.sqrt(grad_x ** 2 + grad_y ** 2 + 1.0)
uni_x = grad_x / A
uni_y = grad_y / A
uni_z = 1.0 / A
vec_el = np.pi / 2.2
vec_az = np.pi / 4.0
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('hand_print_Old_Xing.jpg')

import numpy as np
from PIL import Image



a = np.array(Image.open('Old_Xing.jpg').convert('L')).astype('float')

depth = 10.
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('hand_print_Old_Xing.jpg')
