Consistent traffic timestamp sizing
Made timestamp appear to be the same size as the weather map.
This commit is contained in:
parent
5a4886ad65
commit
f03bb10125
10
nrsc5-dui.py
10
nrsc5-dui.py
@ -894,9 +894,13 @@ class NRSC5_DUI(object):
|
|||||||
|
|
||||||
# now put a timestamp on it.
|
# now put a timestamp on it.
|
||||||
imgMap = imgMap.convert("RGBA")
|
imgMap = imgMap.convert("RGBA")
|
||||||
posTS = (imgMap.size[0]-235, imgMap.size[1]-29) # calculate position to put timestamp (bottom right)
|
imgBig = (981,981) # size of a weather map
|
||||||
imgTS = self.mkTimestamp(t, imgMap.size, posTS) # create timestamp
|
#posTS = (imgMap.size[0]-235, imgMap.size[1]-29) # calculate position to put timestamp (bottom right)
|
||||||
imgMap = Image.alpha_composite(imgMap, imgTS) # overlay timestamp
|
posTS = (imgBig[0]-235, imgBig[1]-29) # calculate position to put timestamp (bottom right)
|
||||||
|
#imgTS = self.mkTimestamp(t, imgMap.size, posTS) # create timestamp
|
||||||
|
imgTS = self.mkTimestamp(t, imgBig, posTS) # create timestamp for a weather map
|
||||||
|
imgTS = imgTS.resize((imgMap.size[0], imgMap.size[1]), Image.LANCZOS) # resize it so it's proportional to the size of a traffic map (981 -> 600)
|
||||||
|
imgMap = Image.alpha_composite(imgMap, imgTS) # overlay timestamp on traffic map
|
||||||
|
|
||||||
imgMap.save(os.path.join(mapDir, "TrafficMap.png")) # save traffic map
|
imgMap.save(os.path.join(mapDir, "TrafficMap.png")) # save traffic map
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user