osm_edge = osm_edge.filter(ImageFilter.BoxBlur(radius=2))
layer_border = self.genborder(osm_edge, "landuse", "meadow")
layer_comp.alpha_composite(layer_border)
- # Give streams a more natural look
- if self._tag == "waterway" and (self._value == "stream" or self._value == "river"):
- osm_edge = osm_edge.filter(ImageFilter.ModeFilter(size=15))
- osm_edge = osm_edge.filter(ImageFilter.BoxBlur(radius=2))
- layer_border = self.genborder(osm_edge, "natural", "wetland")
- layer_comp.alpha_composite(layer_border)
# Store layer
layer_comp_pix[x, y] = ( r,g,b,a[3] )
if self._tag == "waterway" and (self._value == "stream" or self._value == "river"):
d = randrange(1, 15)
- layer_comp_pix[x, y] = ( 129-d, 148-d, 159-d, a[3] )
+ # Rock, grass, water
+ mats = [ (48-d, 45-d, 42-d), (58-d, 81-d, 41-d), (129-d, 148-d, 159-d) ]
+ # Pick one of those
+ pick = randrange(1,4)
+ t = a[3]-d
+ if t < 0: t = 0
+ layer_comp_pix[x, y] = ( mats[pick-1][0], mats[pick-1][1], mats[pick-1][2], t )
if self._tag == "building":
r = randrange(1, 20)
g = 159 - d
b = 138 - d
layer_comp_pix[x, y] = ( r,g,b,a[3] )
+
mstr_msg("mstr_layergen", "Layer image generated")
# Building shadow
mstr_msg("mstr_layergen", "Street lines added")
+ if self._tag == "waterway" and (self._value == "river" or self._value == "stream"):
+ layer_comp = layer_comp.filter(ImageFilter.GaussianBlur(radius=4))
+
# Store layer
layer_comp.save( mstr_datafolder + "_cache\\" + str(self._latitude) + "-" + str(self._lat_number) + "_" + str(self._longitude) + "-" + str(self._lng_number) + "_" + self._tag + "-" + self._value + "_layer.png" )
mstr_msg("mstr_layergen", "Layer image finalized and saved.")
-
-