Skip to content

Instantly share code, notes, and snippets.

@marthall
Last active August 29, 2015 14:08
Show Gist options
  • Save marthall/a72add609ea9ff306b3a to your computer and use it in GitHub Desktop.
Save marthall/a72add609ea9ff306b3a to your computer and use it in GitHub Desktop.
from scipy.misc.pilutil import imread, imsave
import numpy as np
einstein = imread('infile.png')
final_image = np.multiply(einstein, 1.0) # Funker ikke
final_image = np.multiply(einstein, 1) # Funker
final_image = np.multiply(einstein, 1.0).astype(int) # Funker fortsatt ikke
imsave('outfile.png', final_image)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment