推荐学习书目
› 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 · 3059 views
    This topic created in 1553 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
    robotdiy
    Aug 6, 2022
    1
    21m 有点过分啊。
    cz5424
    cz5424
    Aug 6, 2022
    2
    一般 pillow save 后面有参数可以加,查一下文档,像 jpeg 可以调质量
    raycool
    raycool
    Aug 7, 2022
    3
    有 resolution 参数
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   5833 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 03:02 · PVG 11:02 · LAX 19:02 · JFK 22:02
    ♥ Do have faith in what you're doing.