-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Worse image quality with tiles cut using rio-tiler than GDAL #662
Comments
@Plantain I wouldn't compare GDAL COG with rio-tiler but you can compare the output of gdalwarp command to read part of your file import os
from rio_tiler.io import Reader
with Reader("http://static.skysight.io/rio-bug/orig.tiff") as src:
img = src.tile(226, 162 ,8, tilesize=512, reproject_method="nearest", resampling_method="nearest")
with open("226-162-8_RIOTILER.png", "wb") as f:
f.write(img.render())
os.system("gdalwarp -of PNG -q /vsicurl/http://static.skysight.io/rio-bug/orig.tiff 226-162-8_GDAL.png -t_srs EPSG:3857 -ts 512 512 -te 15341217.324948 -5479006.187481 15497760.358876 -5322463.153553 -overwrite") GDALrio-tilerahhhhhh this is because of #654 if you use 6.2.2 we get similar output |
This was with 6.2.3post1, which I think is not affected by that issue? I
think it's even worse again post 6.2.4, I will generate another sample from
that.
…On Thu, 14 Dec 2023, 6:01 pm Vincent Sarago, ***@***.***> wrote:
Closed #662 <#662> as
completed.
—
Reply to this email directly, view it on GitHub
<#662 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACODF7Y4DNG5M4J7XR2LU3YJKW3XAVCNFSM6AAAAABAUBJ2P2VHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJRGI2DINZWGA3TSNQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
#654 was only resolved in 6.2.7 so any version from 6.2.3 to 6.2.7 would have the same behaviour |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When I use rio-tiler directly on (space-projected) tiffs, the quality of the tiles is noticeably worse than if I first cut them to GoogleMapsCompatible COG's using gdal.
I think given GDAL is the backend of rasterio/rio-tiler, and it's cutting the same size output tiles, the result should be the same quality if not pixel-identical.
Data: http://static.skysight.io/rio-bug/orig.tiff
Warp command: gdalwarp -multi -co TILED=YES -wo NUM_THREADS=64 -co BIGTIFF=YES -t_srs EPSG:3857 -of COG -co QUALITY=100 -co COMPRESS=JPEG -co TILING_SCHEME=GoogleMapsCompatible -co ZOOM_LEVEL=7 -co BLOCKSIZE=512 --config GDAL_TIFF_OVR_BLOCKSIZE 512 orig.tiff reproj.tiff
Code:
rio-tiler reprojected and extracted tile:
gdal reprojected and rio-tiler extracted tile:
The difference is subtle but if you zoom right in, you can see the GDAL reprojected tile appears to have double(?) the vertical pixel resolution.
rio-tiler 6.2.3-post1
rasterio 1.3.9 but built with GDAL 3.8.1
GDAL 3.8.1 for the projection
OSX 14.1.2
The text was updated successfully, but these errors were encountered: