export single band geotiff with tranparency
turriper
Global Mapper User
Hi all
I have a 3 colour + 1 alpha band geotiff from which I would like to export 1 colour band (the red) and the alpha band to a new geotiff.
I'm able to, with export raster > geotiff, export the desired colour band by selecting multiband (1, 2) and 8 bits per band and 1 band, with make background pixels transparent.
This loses the alpha channel / transparency I realised, because there's only one band, so I tried exporting with 2 bands, the first whose source was the red channel band 1 and the second whose source was the alpha, band 4 and the make background pixels transparent. This assigns the alpha band in original image to the blue band in the new image however, although intersetingly GIMP interprets the image as intended.
Could you help me work out how to achieve a single colour band + alpha export? I was concerned that the 8-bit palette option would result in loss of imagery data, but perhaps I'm wrong on this.
Thanks very much
I have a 3 colour + 1 alpha band geotiff from which I would like to export 1 colour band (the red) and the alpha band to a new geotiff.
I'm able to, with export raster > geotiff, export the desired colour band by selecting multiband (1, 2) and 8 bits per band and 1 band, with make background pixels transparent.
This loses the alpha channel / transparency I realised, because there's only one band, so I tried exporting with 2 bands, the first whose source was the red channel band 1 and the second whose source was the alpha, band 4 and the make background pixels transparent. This assigns the alpha band in original image to the blue band in the new image however, although intersetingly GIMP interprets the image as intended.
Could you help me work out how to achieve a single colour band + alpha export? I was concerned that the 8-bit palette option would result in loss of imagery data, but perhaps I'm wrong on this.
Thanks very much
Comments
-
Hi turriper,
OK, my understanding of GeoTIFF in't that deep, but 2-band images, while supported, aren't standard. Is that a requirement for your workflow?
In any case, I did this in the raster calculator: I added formulas like this:
Band
Formula
1
B1
2
0
3
0
4
40000
Made a new layer of bit-depth 16. The 40000 value is an alpha of ~60% (40000/65536). Then I exported this as Multi-band/16 bits/4 bands.
Would that be more along the lines of what you're trying to do? Please let me know.
Regards,
~Jeff -
Hi jeff
Thanks I'll try out the raster calculator - I wasn't aware of this
Categories
- 12.7K All Categories
- 5.6K Features Discussion
- 342 Downloading Imagery
- 1.3K Elevation Data
- 380 Georeferencing Imagery Discussion
- 628 GM Script Language
- 53 User Scripts
- 113 GPS Features
- 414 Projection Questions
- 819 Raster Data
- 1.3K Vector Data
- 6.6K Support
- 177 Announcement and News
- 908 Bug Report
- 558 SDK
- 1.2K Suggestion Box
- 3.7K Technical Support
- 562 Other Discussion
- 129 GIS Data Sources
- 27 Global Mapper Showcase
- 233 How I use Global Mapper
- 107 Global Mapper Forum Website