Skip to content
Snippets Groups Projects
Commit 7b910b67 authored by Harry Carey's avatar Harry Carey Committed by GitHub
Browse files

add invert function

parent e8ddb377
No related branches found
No related tags found
No related merge requests found
......@@ -12,8 +12,10 @@ img = tiff.imread(path_to_file)
shape = img.shape
#Get the chunk size
chunk_size = 512
#invert the image if neccessary
img = np.invert(img)
#crop the image and save each chunk
for i in range(0, shape[0], chunk_size):
for j in range(0, shape[1], chunk_size):
chunk = img[i:i+chunk_size, j:j+chunk_size]
tiff.imsave("{}/chunk_{}_{}.tif".format(image_outdir,i, j), chunk)
\ No newline at end of file
tiff.imsave("{}/chunk_{}_{}.tif".format(image_outdir,i, j), chunk)
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment