Comments (4)
这个实现比较麻烦,只有压缩后才能知道大小,如果要实现,需要尝试压缩多次。而且有可能无论怎么压缩都达不到某个大小。
from imagine.
这个实现比较麻烦,只有压缩后才能知道大小,如果要实现,需要尝试压缩多次。而且有可能无论怎么压缩都达不到某个大小。
但是不得不说,这功能非常实用,比如自己的网站,有很多图片,如果原图上传或者不做压缩处理,占用带宽和服务器容量就非常多(虽然有对象存储和CDN,但是能减少一点是一点),如果就限制图片最大不能超过多少kb就非常不错;
其实尝试压缩多次这种方式未必不可,比如一张图片10M想压缩到1M,那么按照质量50%进行压缩,得到5M,再对这图进行质量的50%压缩,一直下去,直到小于1M就可以了。。。可以自定义设置递归深度,比如深度设置为3,超过3就表示压缩失败
要是最后无论如何压缩都不行的话,同样进行显示压缩失败。。。
from imagine.
对呀对呀,要是有这个功能就完美了。
目前我发现有一款“图压”的APP,可以实现制定大小压缩,他也是采用开源的部分代码,不知道他是怎么实现的。可以参考一下。https://tuya.xinxiao.tech/
这款软件很久没更新了,测试发现不支持heic格式压缩
from imagine.
还有这个软件
https://github.com/Lymphatus/caesium-image-compressor
from imagine.
Related Issues (20)
- Convert to JPG doesn't work for me on Windows 10 HOT 6
- 360报毒 HOT 3
- 关于占用的问题抽空解决一下吧 HOT 12
- 重复启动软件后无法压缩 HOT 3
- 反馈一个关于删除文件的bug HOT 1
- 新版本无法保存文件
- 导入类型错误的图片会造成图片无法导入 HOT 1
- [Feature Request] 跳过体积变化不大的图片 HOT 2
- convert webp
- 提个需求,可以支持剪切板的图片吗? HOT 3
- 删除图片信息 HOT 3
- 清空增大文件文件菜单 可否增强下低于减少百分x 也清空 HOT 2
- png转mozjpeg后exif丢失了
- How to upgrade the pngquant lib version and moz-cjpeg lib version? HOT 3
- mac M2 pro fail
- Add option to disable http request (and explain what it is) HOT 1
- 建议增加图像前后对比查看功能,比如这样| HOT 1
- 选择下载的微信“搜一搜公众号推广物料图片”后,软件不显示
- NFR: SVG optimization
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from imagine.