edn = self.find_earthnavdata_number()\r
edns = self.latlng_folder(edn)\r
\r
- cplstr = ""\r
- for c in range(0, len(cpl)):\r
- cplstr = cplstr + str(cpl[c])\r
- if c < len(cpl)-1:\r
- cplstr = cplstr + "_"\r
-\r
- # Find the right color catalogue\r
- cpl_catalog = 0\r
- for c in range(len(mstr_completion_colors)):\r
- if mstr_completion_colors[c][0] == edn:\r
- cpl_catalog = c\r
-\r
- # Put in some pixels\r
- cmpl_bg = Image.new("RGBA", (self._tile.width, self._tile.height))\r
- cmpl_pix = cmpl_bg.load()\r
- for y in range(0, self._tile.height):\r
- for x in range(0, self._tile.width):\r
- idx = randrange(0, len(mstr_completion_colors[cpl_catalog][1]))\r
- clr = mstr_completion_colors[cpl_catalog][1][idx]\r
- cmpl_pix[x,y] = clr\r
- cmpl_bg = ImageEnhance.Contrast(cmpl_bg).enhance(0.8)\r
- cmpl_bg = cmpl_bg.filter(ImageFilter.GaussianBlur(radius=1))\r
- cmpl_bg.alpha_composite(self._tile)\r
- self._tile = cmpl_bg\r
+ cmpl_ptc = Image.open(mstr_datafolder + "textures/tile/completion/ptc.png")\r
+ cmpl_brd = Image.open(mstr_datafolder + "textures/tile/completion/brd.png")\r
+\r
+ # Generate the source image\r
+ for p in range(1, 201):\r
+ rx = randrange(0 - int(cmpl_ptc.width / 2), ptc_full.width - int(cmpl_ptc.width / 2))\r
+ ry = randrange(0 - int(cmpl_ptc.height / 2), ptc_full.height - int(cmpl_ptc.height / 2))\r
+ cmpl.alpha_composite(cmpl_ptc, dest=(rx, ry))\r
+ cmpl.alpha_composite(cmpl_brd)\r
\r
# Patches to add from other sources. If they don't exist, we also need to make them\r
masks = glob.glob(mstr_datafolder + "textures/tile/completion/*.png")\r