将图像从python转换为c#图像大小相差太大

2024-04-26 12:25:01 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试将python中的图像转换为c#,python创建的图像的大小要小得多,而.net正在创建的图像则要大得多。我不想降低图像的质量,不知道为什么会这样。在

这是python代码。在

        if img.mode != "RGB":
        img = img.convert("RGB")
        img = img.resize((width,height), Image.ANTIALIAS)

        resampled_image_name = os.path.splitext(resampled_image_name)[0] + "." + format
        img.save(resampled_image_name)

这是我的密码

^{pr2}$

Tags: 代码name图像imageconvertimgnetif