#!/usr/bin/env python3.6
# -*- coding: utf-8 -*-
from PIL import Image, ImageDraw
image1 = Image.open("1.jpg")
image2 = Image.open("2.jpg")
ANS = Image.open("1.jpg")
draw = ImageDraw.Draw(ANS)
pix1 = image1.load()
pix2 = image2.load()
width = min(image1.size[0], image2.size[0])
height = min(image1.size[1], image2.size[1])
eps = 30
for i in range(width):
for j in range(height):
dx1 = pix1[i, j][0] - pix2[i, j][0]
dx2 = pix1[i, j][1] - pix2[i, j][1]
dx3 = pix1[i, j][2] - pix2[i, j][2]
draw.point((i, j), (abs(dx1), abs(dx2), abs(dx3))) # Зарисовываем ответ разницей пикселов наших картинок по модулю.
ANS.save("ans.jpg", "JPEG")
del draw
*/5 * * * * /usr/bin/vnstat -i eth0 --json > /home/vns.json
*/5 * * * * /usr/bin/vnstat -i eth0 --xml h > /home/vns.xml
import time, json
from pprint import pprint
localtime = time.localtime(time.time())
z = localtime[3]
with open('/home/vns.json') as json_data:
dat_j = json.load(json_data) #
json_data.close()
out = round(dat_j['interfaces'][0]['traffic']['hours'][0]['rx']/1024, 2)
gtf 1920 1080 60 -x # Определяем ModeLine
xrandr --newmode "1920x1080_60.00" 172.80 1920 2040 2248 2576 1080 1081 1084 1118 -HSync +Vsync # Устанавливаем согласно выхлопа gtf(Будет, разумеется, наверняка другой)
xrandr --addmode VGA1 1920x1080_60.00 # Добавляем
xrandr --output VGA1 --mode 1920x1080_60.00 # Активируем