]> marstr Code Repo - marstr/orthographic.git/commitdiff
Another correction to farmland lines
authorMarcus Str. <marcus@marstr.online>
Tue, 4 Feb 2025 14:21:16 +0000 (15:21 +0100)
committerMarcus Str. <marcus@marstr.online>
Tue, 4 Feb 2025 14:21:16 +0000 (15:21 +0100)
maskgen.py

index 15572a191487b20fbeed724df35594c9ef4d3f49..78017ecfe0c45b9147de061f94180d05a0f79e2e 100644 (file)
@@ -269,7 +269,7 @@ class mstr_maskgen:
             lines = Image.new("RGBA", (2048,2048))\r
             mask_pix = mask_img.load()\r
             pts = []\r
-            for l in range(96, 201):\r
+            for l in range(21,51):\r
                 p = ( randrange(0,2048), randrange(0,2048) )\r
                 pts.append(p)\r
             imgl = ImageDraw.Draw(lines)\r
@@ -278,8 +278,9 @@ class mstr_maskgen:
             linepix = lines.load()\r
             for y in range(0, 2048):\r
                 for x in range(0, 2048):\r
+                    mp = mask_pix[x,y]\r
                     lp = linepix[x,y]\r
-                    if lp[3] > 0:\r
+                    if lp[3] > 0 and mp[3] > 0:\r
                         c = (0,0,0,255-lp[3])\r
                         mask_pix[x,y] = c\r
 \r