嗨,我有一个文件采集器,采取一个图像,并保存为一个jpg,但它看起来很可怕。请帮帮我,我不知道为什么看起来不好。在
def getfile(self):
fname = QFileDialog.getOpenFileName(self, 'Open file',"","Image files (*.jpg *.gif)")
print(fname)
img = QImage(fname)
img = img.convertToFormat(QImage.Format_Indexed8,Qt.ThresholdDither|Qt.AutoColor)
newname = 'Old/'+ time.strftime("img%Y%m%d%H%M%S") + '.jpg'
print(newname)
os.rename('Background.jpg', newname)
img.save('Background.jpg', "jpg", 100)
我把它设为100,但还是没用
这样做的目的是允许用户添加图像作为背景,但是如果图像是png或bmp,则将其转换为jpeg,以便使用背景.jpg““
目前没有回答
相关问题 更多 >
编程相关推荐