使用PyQt5批量处理图片文件夹中的所有图像。该程序可以批量调整图像大小并将其保存到新的文件夹中。
代码如下:
import os
from PyQt5.QtWidgets import QApplication, QWidget, QVBoxLayout, QHBoxLayout, QLabel, QLineEdit, QPushButton, QFileDialog
from PyQt5.QtGui import QPixmap, QImage
from PyQt5.QtCore import Qt
class ImageResizer(QWidget):
def __init__(self):
super().__init__()
# 初始化界面
self.initUI()