hotosm / oam-dynamic-tiler

Dynamic tiling of raster data for OpenAerialMap + others
Other
35 stars 12 forks source link

Make black collar areas transparent #50

Open cgiovando opened 6 years ago

cgiovando commented 6 years ago

Not sure whether this is a bug or maybe just a suggestion at this point - but I thought that black areas around images were automatically made transparent. Here's one that still has the black collar:

https://map.openaerialmap.org/#/177.53442764282227,-17.667924459220117,16/3111331022111311/59cc69c446e19904aab0ae83?_k=jveg47

I'm wondering if this is caused by the fact that I reduced the GeoTIFF file with JPEG compression before uploading?

This affects both the thumbnail and TMS rendering.

Also, possibly related to #48 ?

mojodna commented 6 years ago

When you added JPEG compression locally, you probably lost the nodata values / mask. If the image has an alpha channel, that will be used as the mask (but it needs to punch out the collar).

As we roll out the new tiler, I'm investigating an opt-in option to do near-black handling (2+ contiguous pixels that are black or close to it will be treated as nodata instead).