Git Product home page Git Product logo

compressimg's Introduction

批量图片压缩程序

简介

有时上传头像时会提示图片尺寸过大导致上传失败,而本款软件能解决此类问题。
能够批量将in文件夹内的图片压缩,并存放到out文件夹中。
可自定义一些压缩参数,已有示例图片可供测试。

简单展示 v1.1.0 (增添可压缩多级目录下的图片)

如下图是运行压缩图片程序前的效果

如下图是运行压缩图片程序后的效果

python运行

运行压缩图片程序的命令

python compressimg.py

可自定义参数

这些可以在main函数中自定义
dirin = 'in' # 输入图片的文件夹。这里是放准备压缩的图片,默认文件夹名称为in
dirout = 'out' # 输出图片的文件夹。这里会存放压缩好的图片,默认文件夹名称为out
sizeKB = 100 # 输出图片的最大值,默认100KB。压缩好的图片尺寸不会超过100KB
xout = 1366 # 输出图片的x轴长度,默认1366px,y轴通过动态计算得到。

简单展示 v1.0.0

如下图是运行压缩图片程序前的效果

如下图是运行压缩图片程序后的效果

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.