#!/usr/bin/python3
import cv2
import numpy as np
import glob, os


work_path = os.getcwd()

for infile in glob.glob(work_path + "/fullsize/*.png"):
    file, ext = os.path.splitext(infile)
    im = cv2.imread(infile)
    filename = file.split('/')[-1:][0]

    res256 = cv2.resize(im, dsize=(256, 256), interpolation=cv2.INTER_CUBIC)
    cv2.imwrite("256/" + filename + '.jpg', res256)

    res512 = cv2.resize(im, dsize=(512, 512), interpolation=cv2.INTER_CUBIC)
    cv2.imwrite("512/" + filename + '.jpg', res512)

    res1024 = cv2.resize(im, dsize=(1024, 1024), interpolation=cv2.INTER_CUBIC)
    cv2.imwrite("1024/" + filename + '.jpg', res1024)

    res1536 = cv2.resize(im, dsize=(1536, 1536), interpolation=cv2.INTER_CUBIC)
    cv2.imwrite("1536/" + filename + '.jpg', res1536)

