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

Color to alpha is applied to all layers indifferently #25

Open
guisalmon opened this issue Jul 17, 2013 · 0 comments
Open

Color to alpha is applied to all layers indifferently #25

guisalmon opened this issue Jul 17, 2013 · 0 comments

Comments

@guisalmon
Copy link

Code :

import logging
from landez import MBTilesBuilder
from landez import TilesManager
from landez.filters import ColorToAlpha


logging.basicConfig(level=logging.DEBUG)

mb = MBTilesBuilder(mbtiles_file="/home/guillaume/Tiles/Merge/tiles.mbtiles",
                    cache=True, filepath="/home/guillaume/Tiles/Merge/blended.mbtiles")
overlay = TilesManager(mbtiles_file="/home/guillaume/Tiles/Merge/tiles_kml_v3.mbtiles")
overlay.add_filter(ColorToAlpha('#ffffff'))
mb.add_layer(overlay)
mb.add_coverage(bbox=(4.9919,42.8865,5.6985,43.2997),
                zoomlevels=range(10,18))
mb.run()

This is supposed to blend osm maps (tiles.mbtiles) and a layer containing colored areas (tiles_kml_v3.mbtiles) with #ffffff to alpha in the second layer. The fact is, white is sent to alpha in both layers but only in the areas defined in the second layer. This is the result :
648
(Yes, with the white background on github, it doesn't change anything, it is more evident on a non-plain background, on GIMP for instance)

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

1 participant