bld_shadow.save(fn)\r
\r
\r
+ # Let's apply a trick that came to me one night :)\r
+ # Adds random lines to farmland areas\r
+ if (self._tag == "landuse" and self._value == "farmland") or (self._tag == "landuse" and self._value == "farmyard"):\r
+ lines = Image.new("RGBA", (2048,2048))\r
+ mask_pix = mask_img.load()\r
+ pts = []\r
+ for l in range(96, 201):\r
+ p = ( randrange(0,2048), randrange(0,2048) )\r
+ pts.append(p)\r
+ imgl = ImageDraw.Draw(lines)\r
+ imgl.line(pts, fill="#000000", width=1, joint="curve")\r
+ lines = lines.filter(ImageFilter.GaussianBlur(radius=1))\r
+ linepix = lines.load()\r
+ for y in range(0, 2048):\r
+ for x in range(0, 2048):\r
+ lp = linepix[x,y]\r
+ if lp[3] > 0:\r
+ c = (0,0,0,255-lp[3])\r
+ mask_pix[x,y] = c\r
+\r
# Inform\r
mstr_msg("maskgen", "Mask built.")\r
\r