我有jpg格式的图像,并且我不想转换为png格式来解决此错误,而无需通过其他任何方式来解决此错误
input_image = Image.open(image_path).convert('RGBA')
txt = Image.new('RGBA', input_image.size, (255, 255, 255, 0))
实际上,我想根据我的代码创建水印图像,我必须强制使用RGBA模式。请给我解决办法
错误:无法将RGBA模式写入JPEG
答案 0 :(得分:0)
String clusterName = channel.getClusterName();
String clusterAddress = channel.getAddressAsString();
String localAddress = channel.getProtocolStack()
.dumpStats()
.get("UDP")
.get("local_physical_address")
.toString();
StringBuilder border = new StringBuilder();
String GMS = String.format("GMS: address=%s, cluster=%s, physical address=%s",
clusterAddress,
clusterName,
localAddress
);
logger.info("{}", GMS);
不支持JPG
alpha = transparency
,RGBA
有P
alpha = transparency
= RGBA
Red Green Blue Alpha
cannot write mode RGBA as JPEG
cannot write mode P as JPEG
alpha = transparency
转换为Image
RGB
JPG