Advertisement
Guest User

Untitled

a guest
Oct 16th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. def to_sepia(image):
  2. sepia = np.array(image)
  3. sepia[:, :, 0] = image[:, :, 0] * 0.272 + image[:, :, 1] * 0.534 + image[:, :, 2] * 0.131
  4. sepia[:, :, 1] = image[:, :, 0] * 0.349 + image[:, :, 1] * 0.686 + image[:, :, 2] * 0.168
  5. sepia[:, :, 2] = image[:, :, 0] * 0.393 + image[:, :, 1] * 0.769 + image[:, :, 2] * 0.189
  6.  
  7. print(sepia)
  8.  
  9. return sepia
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement