Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/python-2.7/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 2.7 PythonWand正在增加文件大小_Python 2.7_Wand - Fatal编程技术网

Python 2.7 PythonWand正在增加文件大小

Python 2.7 PythonWand正在增加文件大小,python-2.7,wand,Python 2.7,Wand,我试图使用python Wand库,但我所做的任何操作都会导致生成的文件比原始文件大得多(文件大小)!考虑一下我在Ubuntu机器上测试的下面的简单例子: with Image(filename='input.pdf', resolution=300) as test: test.save(filename='output.pdf') 我的输入文件是一份10页的扫描文件,分辨率为300dpi。它需要3mb的磁盘空间。如果在打开图像时未指定分辨率,则输出的pdf仅为1mb,但质量非常差(

我试图使用python Wand库,但我所做的任何操作都会导致生成的文件比原始文件大得多(文件大小)!考虑一下我在Ubuntu机器上测试的下面的简单例子:

with Image(filename='input.pdf', resolution=300) as test:
    test.save(filename='output.pdf')
我的输入文件是一份10页的扫描文件,分辨率为300dpi。它需要3mb的磁盘空间。如果在打开图像时未指定分辨率,则输出的pdf仅为1mb,但质量非常差(无法读取)。指定分辨率300(与原始文件相同)时,生成的文件为30mb,比原始文件大10倍

如果您能简单地以与原始图像相同的压缩/分辨率保存图像,将不胜感激

谢谢