Move python to scripts dir

This commit is contained in:
OleSTEEP 2024-07-05 00:13:22 +03:00
parent e85110f4eb
commit a8a23150d9
6 changed files with 5 additions and 6 deletions

21
scripts/generate_icons.py Normal file
View file

@ -0,0 +1,21 @@
#/usr/bin/env python3
import cv2
original_icons = ["ic_launcher_background.png",
"ic_launcher_foreground.png",
"ic_launcher_monochrome.png",
"ic_launcher.png"]
resolutions = [
["ldpi", 36, cv2.INTER_AREA],
["mdpi", 48, cv2.INTER_AREA],
["hdpi", 72, cv2.INTER_AREA],
["xhdpi", 216, cv2.INTER_NEAREST],
["xxhdpi", 324, cv2.INTER_NEAREST]]
for res in resolutions:
for icon in original_icons:
image = cv2.imread(f"res/android/xxxhdpi/{icon}", cv2.IMREAD_UNCHANGED)
print(f"* [{res[0]}] {icon}")
resize = cv2.resize(image, (res[1], res[1]), interpolation=res[2])
cv2.imwrite(f"res/android/{res[0]}/{icon}", resize)