使用Python进行图片格式转化/分辨率转化

一.下载python PIY插件库

     PIP下载命令: pip install pillow -i https://mirrors.aliyun.com/pypi/simple

     PIY插件库:pillow Installation - Pillow (PIL Fork) 10.3.0.dev0 documentation

二.分辨率转化

from PIL import Image
import os

resolution = (1024, 1024)
with Image.open("spyglass.png") as img:
    img_resized = img.resize(resolution)
    img_resized.save("spyglass.png")

相关推荐

  1. 使用Python进行图片格式转化/分辨率转化

    2024-03-15 21:26:02       44 阅读
  2. 如何使用ffmpeg转换图片格式

    2024-03-15 21:26:02       54 阅读
  3. springboot整合s3,用ImageIO进行图片格式转换

    2024-03-15 21:26:02       31 阅读
  4. 图片转为编码格式

    2024-03-15 21:26:02       31 阅读
  5. Python 进行图片转换为pdf

    2024-03-15 21:26:02       40 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-03-15 21:26:02       98 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-03-15 21:26:02       106 阅读
  3. 在Django里面运行非项目文件

    2024-03-15 21:26:02       87 阅读
  4. Python语言-面向对象

    2024-03-15 21:26:02       96 阅读

热门阅读

  1. Python注册用法

    2024-03-15 21:26:02       42 阅读
  2. 计算机网络基础

    2024-03-15 21:26:02       30 阅读
  3. Mysql中的engine

    2024-03-15 21:26:02       45 阅读
  4. Oracal序列冲突问题解决

    2024-03-15 21:26:02       43 阅读
  5. 一文解读ISO26262安全标准:功能安全管理

    2024-03-15 21:26:02       45 阅读
  6. 用try...catch进行判断

    2024-03-15 21:26:02       31 阅读
  7. Python中,如何读取和写入文件?

    2024-03-15 21:26:02       42 阅读
  8. vue3的组件间的v-model参数

    2024-03-15 21:26:02       37 阅读
  9. vue3之组合式函数

    2024-03-15 21:26:02       47 阅读
  10. TCP并发模型

    2024-03-15 21:26:02       37 阅读