Last active
May 25, 2020 01:01
-
-
Save BilHim/c2bb44202db0a842d82a67131e27fddf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PIL import Image | |
width = 800 | |
height = 600 | |
def getpixel(x, y): | |
n = 0.5 # Get value here | |
return int(255*n) | |
# Create a new image. L for grayscale | |
im = Image.new('L', (width, height)) | |
for x in range(width): | |
for y in range(height): | |
im.putpixel((x, y), getpixel(x, y)) | |
im.save('displacement_map.png') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment