Changes between Initial Version and Version 1 of Ticket #5478, comment 2
- Timestamp:
- Mar 19, 2016, 7:51:13 AM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #5478, comment 2
initial v1 1 Both of the file formats are of the type byte. When you compute A*20 + B, you are overshooting the byte-limits of the layer channel (255). For instance, if the histogram values of A and B (for a particular pixel of a raster layer) are 123 and 77 respectively, then A*20 + B >> 255. The image that will be the output is wrongly formatted. For such an operation, I recommend scaling the images to a higher format (maybe word-aligned/32-bit channel) using gdal_translate [http://www.gdal.org/gdal_translate.html] and then computing the same. In the meanwhile, I will try to write a patch that detects this anomaly and issues a suitable warning.1 Both of the file formats are of the type byte. When you compute A*20 + B, you are overshooting the byte-limits of the layer channel (255). For instance, if the histogram values of A and B (for a particular pixel of a raster layer) are 123 and 77 respectively, then A*20 + B >> 255. The image that will be the output is wrongly formatted. For such an operation, I recommend scaling the images to a higher format (maybe word-aligned/32-bit channel) using gdal_translate [http://www.gdal.org/gdal_translate.html] and then computing the same.