推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
xpyusrs
V2EX  ›  Python

PIL 库打开图片保存为 pdf,转的 pdf 文件超级大, 怎么解决

  •  
  •   xpyusrs · Aug 5, 2022 · 2713 views
    This topic created in 1401 days ago, the information mentioned may be changed or developed.
    from PIL import Image, ImageFile
    newImg = Image.open('test.gif')
    newImg.save('1111.pdf')
    

    我就打开一个 63kb 的图片, 存成 pdf 文件居然有 21MB 这么大, 大佬们帮帮忙

    3 replies    2022-08-07 15:50:50 +08:00
    robotdiy
        1
    robotdiy  
       Aug 6, 2022
    21m 有点过分啊。
    cz5424
        2
    cz5424  
       Aug 6, 2022
    一般 pillow save 后面有参数可以加,查一下文档,像 jpeg 可以调质量
    raycool
        3
    raycool  
       Aug 7, 2022
    有 resolution 参数
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   850 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 21:05 · PVG 05:05 · LAX 14:05 · JFK 17:05
    ♥ Do have faith in what you're doing.