21 lines
No EOL
726 B
Python
21 lines
No EOL
726 B
Python
#/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) |