Comments (3)
@slesim Can you attach such a file ? I believe the root cause is that TIFF color table entries are expressed as values in the [0,65535] range, and not [0,255], so software has to do remapping. GDAL uses division by 257 and truncation to do the conversion from [0,65535] to [0,255]. Other software might have slightly different approaches. The TIFF specification doesn't specify how to do that remapping
Current behaviour dates back to this changeset eeec5b6 that went in GDAL 2.3.0. Previously division by 256 was done.
from gdal.
Tifffile does not do any conversion or remapping. tif.pages[0].tags['ColorMap'].value
is a numpy array of dtype uint16
.
The conversion in the example code is int.from_bytes(r[i])
, which is wrong in general but happens to give expected results for multiples of 256.
from gdal.
Thanks for your answers, it helps my understanding.
Here is a sample file :
rugoIndex.zip
from gdal.
Related Issues (20)
- Contrary to man page gdalbuildvrt does not fetch from the last file when there is spatial overlapping HOT 3
- ogrinfo: input file should be optional HOT 4
- MySQL-Support in gdal on Mac missing HOT 1
- Support for GML <OrientableCurve> tag HOT 4
- OSM Toner doesn't work in gdal2tiles HOT 1
- Add dataset creation options for GML driver to place geometry field after attribute fields HOT 7
- Invalid nodata value in gdal_rasterize when output is int64 HOT 3
- Converting non-LZW-compressed GeoTIFF to PNG produces black image HOT 1
- ogr2ogr does not see Postgresql schemas on gdal 3.9.0 HOT 10
- Unable to write KMZ to Cloud Storage
- Java Bindings fail when building from source on MacOS, GDAL 3.7.0 and newer. HOT 7
- Issue in gdal.Grid called from python bindings HOT 1
- memory leak gdalenhance.cpp
- GMLAS driver: not correct geometry fields HOT 4
- Task: Remove CPLList
- gml writer: FeatureCollection's envelope SRS (3.9.1 regression) HOT 3
- gdal_retile moves tiles a few KM from where their source GeoTIFF's footprint was HOT 5
- Calculated clipsrc area is too small for pdf to geojson ogr2ogr conversion HOT 3
- gdallocationinfo: extra line is output if coordinate is outside raster extent (3.9.0 regression)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gdal.