-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Enhancement: support premultiplied raw pixel input #1599
Comments
Hello, what is the source of What does |
https://github.com/klokantech/tileserver-gl/blob/master/src/serve_rendered.js |
|
Sorry, I didn't quite understand what it was about in this post. |
It looks like The quick fix would probably be to modify |
Thanks for help, I've add the issue to server's author, because haven't found the solution myself. The are no using mbgl-renderer as javascript-library, I see only mbgl/renderer c-sources and can't move futher, unfortunately |
Let's leave this open to track a future possible enhancement to flag premultiplied raw pixel data input via an additional property on the |
v0.28.2 now available with support for this via the following API: sharp(input, { raw: { premultiplied: true, ... } })... |
Maplibre-native outputs premultiplied pixels values. The sharp library did not support it so we added code to cancel the alpha premultiplication. Note that this can only visible onr raster tiles (and probably static maps). The sharp library now supports premultiplied pixels with the right config. Let's use it: it should be faster and easie to maintain. Feature announced here: lovell/sharp#1599 (comment) Feature developped here by @mnutt: lovell/sharp#2685 Signed-off-by: Martin d'Allens <martin.dallens@liberty-rider.com>
Maplibre-native outputs premultiplied pixels values. The sharp library did not support it so we added code to cancel the alpha premultiplication. Note that this can only visible onr raster tiles (and probably static maps). The sharp library now supports premultiplied pixels with the right config. Let's use it: it should be faster and easie to maintain. Feature announced here: lovell/sharp#1599 (comment) Feature developped here by @mnutt: lovell/sharp#2685 Signed-off-by: Martin d'Allens <martin.dallens@liberty-rider.com>
Maplibre-native outputs premultiplied pixels values. The sharp library did not support it so we added code to cancel the alpha premultiplication. Note that this can only visible onr raster tiles (and probably static maps). The sharp library now supports premultiplied pixels with the right config. Let's use it: it should be faster and easie to maintain. Feature announced here: lovell/sharp#1599 (comment) Feature developped here by @mnutt: lovell/sharp#2685 Signed-off-by: Martin d'Allens <martin.dallens@liberty-rider.com>
Thanks for utility, great work.
I use the utility inside the map-tile-server-gl node-app. Server configuration when rendering raster tiles allows you to set the color of the lines in rgba. But as a result, PNG-images enclose a gray or black substrate under the translucent white color. Result on the attached screenshot.
Images on the server are created as follows:
I tried using .embed (), .ensureAlpha (), passing the create parameter to the constructor, pointing to background with transparent white, but it didn’t work.
![image](https://user-images.githubusercontent.com/16482115/53805477-4d1f9500-3f5b-11e9-8520-a6a3ff5d3dbb.png)
How do I get a white backing in white translucent color, or do I get a 24-bit PNG supporting translucent colors?
The text was updated successfully, but these errors were encountered: