Skip to content
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

image layer with transparent color #7463

Closed
json87 opened this issue Jan 5, 2019 · 3 comments
Closed

image layer with transparent color #7463

json87 opened this issue Jan 5, 2019 · 3 comments

Comments

@json87
Copy link

json87 commented Jan 5, 2019

thanks for providing the excellent tool. Recently, I used it to load a local image, and found that the white background is also shown. Thus, is there any layer attribution to set transparent color.

1243d171-a648-f435-626f-1d56bc680ac1

@OmarShehata
Copy link
Contributor

Can you show how you're loading this image? Transparency should work fine if you're loading in a PNG. Here's a Sandcastle I just tried. You can see the transparency in the Cesium logo renders correctly as an imagery layer.

@GatorScott
Copy link

I don't know of any way to say that "white" should be treated as transparent. The image must contain an alpha/transparency channel.

@hpinkos
Copy link
Contributor

hpinkos commented Jan 7, 2019

@json87 Yes, I think this is a problem with your image. There's nothing in CesiumJS to specify a nodata color. If this image is a png and you're using the SingleTileImageryProvider, make sure the PNG image has those areas transparent instead of white. Formats like jpg don't have an alpha channel, so you may need to convert it to a different format. If you need more help with this, try posting a question on the forum: https://groups.google.com/forum/?hl=en#!forum/cesium-dev
A lot more users see the forum, so it's more likely that someone else has encountered a similar problem and may be able to help. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants