Created
November 21, 2017 23:10
-
-
Save Chandler/1f4d3b6d423ed3c797595f2c734cef95 to your computer and use it in GitHub Desktop.
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 numpy as np | |
import rasterio | |
original = rasterio.open("original.tif").read() | |
# cmd: | |
# convert -compress LZW -type TrueColor original.tif lossless.tif | |
lossless = rasterio.open("lossless.tif").read() | |
# cmd: | |
# convert original.tif -type TrueColor lossy.jpg | |
lossy = rasterio.open("lossy.jpg").read() | |
print original.shape, lossless.shape, lossy.shape | |
#passes yay | |
np.testing.assert_almost_equal(original, lossless) | |
# fails | |
np.testing.assert_almost_equal(original, lossy) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment