You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
During rendering, when a map is rendered with data layers that have an opacity value less than fully opaque, and no background layers, colours are darkened.
For example, if I render a single tile using a data layer and simple styling (put white circles where the data points are), the more transparent parts of the circles (around the edges) are darkened, as if they've been blended with a black colour.
I believe this opacity issue is also effecting other types of data layer generated with no background, for example filled geometries.
This issue does not impact rendered layers that have a background beneath them. Only when there's nothing beneath the
To Reproduce
Steps to reproduce the behavior:
Create a map style with:
No background layer
A single simple data layer that uses colours with opacity < 1
Setup any data source for that layer (for example, I'm using data from our database, that plots certain locations as points)
Render the map
Inspect the result
Example style JSON I've been using. Note: I've had to redact the data source (`sources`) info.
I would expect the colours to remain true, with just an alpha channel applied to them.
My use-case is to be able to render data layers on their own, with opacity/transparency and colours correct that it can be overlayed on other images in a separate system.
Screenshots
Example using a simple white circles layer:
Example of the same white circles when rendered with a white-background:
Note that in the second example, the colours of the transparent sections are not "darkened" as they are in the first example.
And a final example:
This time using a red background to show that the opacity blends with the underlying background layer totally fine when there is one. It's just a problem that it weirdly darkens the more transparent pixels when there's no underlying colour.
Platform information (please complete the following information):
Operating System: Linux
Platform (e.g. Node.js, Qt): Node.js
Version: "@maplibre/maplibre-gl-native": "5.1.1"
Additional context
To be sure I'm not contaminating the render result with my own code post-render. The code I'm using to "save" the render result is:
map.render(renderOptions,asyncfunction(err,buffer){if(err)throwerr;map.release();varimage=sharp(buffer,{raw: {width: 512,height: 512,channels: 4}});// Convert raw image buffer to PNGawaitnewPromise<void>((resolve,reject)=>{image.toFile('image.png',function(err){if(err)throwreject(err);resolve();});});});
The text was updated successfully, but these errors were encountered:
For a while there's also been interest in a feature to control blending modes. Which I'm not certain but I'd guess if that had ever been implemented it would help give control over this. (Issue maplibre/maplibre#170)
Describe the bug
During rendering, when a map is rendered with data layers that have an opacity value less than fully opaque, and no background layers, colours are darkened.
For example, if I render a single tile using a data layer and simple styling (put white circles where the data points are), the more transparent parts of the circles (around the edges) are darkened, as if they've been blended with a black colour.
I believe this opacity issue is also effecting other types of data layer generated with no background, for example filled geometries.
This issue does not impact rendered layers that have a background beneath them. Only when there's nothing beneath the
To Reproduce
Steps to reproduce the behavior:
Example style JSON I've been using. Note: I've had to redact the data source (`sources`) info.
Expected behavior
I would expect the colours to remain true, with just an alpha channel applied to them.
My use-case is to be able to render data layers on their own, with opacity/transparency and colours correct that it can be overlayed on other images in a separate system.
Screenshots
Example using a simple white circles layer:
Example of the same white circles when rendered with a white-background:
Note that in the second example, the colours of the transparent sections are not "darkened" as they are in the first example.
And a final example:
This time using a red background to show that the opacity blends with the underlying background layer totally fine when there is one. It's just a problem that it weirdly darkens the more transparent pixels when there's no underlying colour.
Platform information (please complete the following information):
Additional context
To be sure I'm not contaminating the render result with my own code post-render. The code I'm using to "save" the render result is:
The text was updated successfully, but these errors were encountered: