有没有使用任何技术来压缩 jpeg 来减少上传时间?
我有一个在线工具,其他用户可以通过该工具上传照片。用户在使用较慢的带宽时遇到问题。
我找到了这个 http://en.wikipedia.org/wiki/Lossless_data_compression
1)有没有任何工具或使用该算法的API?
2)由于能够本地压缩,会减慢上传过程吗?
I have an online tool through which another user upload photos. The user is having issues when using slower bandwidth.
I found this
http://en.wikipedia.org/wiki/Lossless_data_compression
1) Is there any tool or API that utilizes this algorithm?
2) Will it slow the upload process for being able to compress locally?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Jpeg 已经被压缩。如果您尝试压缩 jpeg,它不会完整收缩,由于属于 zip 文件格式的元数据,它会稍微增长。
Jpegs are already compressed. If you try and zip a jpeg it won't shrink intact it will grow ever so slightly due to metadata belonging to the zip file format.
WinZip 是无损数据压缩工具的一个示例......
然而,您可能是在浪费时间,因为您几乎找不到任何无损压缩可以减少超过 1-10% 的大小。
如果有的话!
总而言之,您将被迫在上传过程中进行任何显着的更改 - 如果您真的非常想压缩文件中的内容,则需要花费很长时间。
我认为,最好的机会是在必要时重新压缩和/或调整图像大小。
WinZip is an example of a tool that does lossless data compression...
However, you are probably wasting your time since you will hardly find any lossless compression that does more than a 1-10% size reduction.
If at all!
All in all you will be pressed to get any noteable change in the upload process - except for getting it to take VERY long if you really, really want to compress the heck out of your file.
I think, your best chance is to recompress and/or resize the image if necessary.
压缩需要时间。如果上传需要 X 时间,压缩需要 Y 时间以减少 Z 个百分比的大小,那么您的目标是获得
Y + X - Z*X
Y + X - Z*X
Y + X - Z*X
X。考虑到打开压缩程序所需的人力时间,Y 可能相对来说是一个非常大的数字,并且您不太可能获得任何好处。
最好的选择是某种形式的有损压缩。优秀的有损压缩程序是一个简单的图片编辑器,允许您裁剪和调整大小。如果您可以剪掉不需要的图像部分并删除不必要的分辨率信息,则可能会获得明显的尺寸差异。
尽管如此,我的建议只是花额外的钱来获得良好的互联网连接。如今,有线甚至卫星电话并不比拨号贵多少。
Compression takes time. If it takes X time to upload and it takes Y time to compress for a Z percentage decrease in size, then your goal is to get
Y + X - Z*X < X
. Given the human time necessary to even open up a compression program, Y is likely to be a very large number comparably, and it's highly unlikely that you're going to gain any benefit.Your best bet is some form of lossy compression. An excellent lossy compression program is a simple picture editor that allows you to crop and resize. If you can cut out the parts of the image you don't want and remove the resolution information that is unnecessary, you might be able to get an appreciable difference in size.
Still, my recommendation is simply to shell out the extra cash for a decent internet connection. Cable or even satellite isn't that much more expensive than dialup these days.