-
Notifications
You must be signed in to change notification settings - Fork 184
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
Writing tiffs with alpha channel #385
Comments
Hi, @timhj . That's an excellent question. geotiffwriter.js is still in beta, so there are definitely things that are missing. Could you try to add |
Technically speaking if you need a quick workaround you could also define a no-data value and use that like transparency. Most applications won't display those values, but it's a far from perfect workaround. And here's a few more notes in case you are curious: References:
Technically speaking there's another way to add transparency information to a geotiff, but that's not supported either. That involves creating a separate transparency mask image. However, that would involve adding support to geotiffwriter for writing multiple images for one geotiff file and that is not currently supported either. @daumann currently has a promising PR out adding more bit-depth options when writing: #366 Things are looking up! Seems like there's a lot of momentum around geotiff writing at the moment! :-) |
@DanielJDufour - Is it the WriteArrayBuffer in GeoTIFF.js that's flattening/transposing no data pixels to white and dropping the alpha channel? |
writeArrayBuffer shouldn't be changing any values, but there always could be a bug. Would you be able to write a test or provide the code you are using? I think it'll make the debugging process easier. |
@DanielJDufour - This was resolved without any issue in the library. Setting an incorrect |
Using writeArrayBuffer to write a GeoTIFF from a canvas object with a transparent background results in the the alpha channel being replaced with white in the resulting TIFF.
The
SamplesPerPixel
is set to 4 in the metadata to specify RGBA but the alpha channel is missing in the resulting tiff.I imagine this is because writing transparency is not supported by
geotiff.js
.If that's the case is it possible to add in support for alpha channel writing?
The text was updated successfully, but these errors were encountered: