Created
May 20, 2015 15:57
-
-
Save alamsal/eefc08e5b9bc7c6a853a to your computer and use it in GitHub Desktop.
Tiler tools boundary clean up / An alternate to PIL Mogrify
This file contains 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
import sys | |
from PIL import Image | |
imageFullPath = sys.argv[1] | |
rasterImage = Image.open(imageFullPath) | |
width,height = rasterImage.size | |
rasterImage = rasterImage.convert('RGBA') | |
pix = rasterImage.load() | |
for i in range(0, width): | |
for j in range(0, height): | |
if(pix[i,j][0] == 0): | |
pix[i,j] = (255,255,255,0) | |
rasterImage.save(imageFullPath,'PNG') | |
# run BoundaryCleanup.py fileName |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment