第一版下载图片后设为壁纸,四周都是黑黑的不好看, 所以结合本地壁纸将两张图片进行合成
只要计算一下要缩减的大小与要放置的位置
我的方法是:打开 gimp,合成两张图片,记下缩减的大小(214,214)与位置(160,160)
每次只要运行一下
python himawari8.py
源码
from PIL import Image, ImageOps, ImageDraw
from io import BytesIO
from urllib.request import Request, urlopen
from datetime import datetime, timedelta
import json
SCALE = 2
WIDTH = 1368
HEIGHT = 768
def get_info():
url = "http://himawari8-dl.nict.go.jp/himawari8/img/D531106/latest.json"
request = Request(url …