改变图片扩展 [英] Change pics extension

查看:64
本文介绍了改变图片扩展的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

数千张图片(目录)

到最小尺寸而不会损失质量或分辨率

什么扩展名,代码plz ...

thousands of images (directory)
to minimal size without loss of quality or resolution
what extension, code plz...

推荐答案

这个问题没有多大意义,因为扩展没有任何意义。首先,事实上,没有文件扩展名。它们处于过时的文件系统中,但现在仍然使用扩展一词,但在不同意义上,它只是作为文件名的一部分,仍然用于表示文件类型。它不会影响任何功能。其次,扩展仅表示某种文件类型,但对实际内容说的很少或根本没有。例如,* .TIFF表示TIFF容器,它不能使用不同类型的压缩,有损或无损压缩。所以,忘了扩展。可能你需要一些无损算法,我不能确定你真的需要它,考虑到使用有损算法你可以得到更小的尺寸而不会明显损失可见质量。



此外,与普遍看法相反,分辨率与像素中的图像大小无关。此外,作为元数据的一部分的分辨率不会影响屏幕上图像的视图,根本不会影响。这只是建议的默认值,例如,可以用于将图像打印为sm或英寸的默认尺寸。



目前还不清楚最小尺寸可能意味着。如果您的意思是图像文件的大小(以字节为单位),那么很明显,您可以通过无损压缩来缩小大小,但不是很多。理解近似最优算法实际上取决于每个单独的图像是非常重要的:对于一个,可以使用具有一组参数的一个算法,对于不同的图像,不同的算法和参数集可以更好。您可以尝试不同的方法,并选择能够提供更好结果的方法,可能是基于图像到图像。



请参阅:

http://en.wikipedia.org/wiki/Lossless_compression [ ^ ],

http://en.wikipedia.org/wiki/Data_compression [ ^ ],

http://en.wikipedia.org/ wiki / Lossy_compression [ ^ ],

http://en.wikipedia.org/wiki/Data_compression [ ^ ]。



您可以尝试上面引用的文章中列出的算法。 />


-SA
This question does not make much sense, because "extensions" means nothing. First, in fact, there are no file "extension". They were in obsolete file systems, but now the word "extension" is still used, but in a difference sense, just as a part of file name, and is still used to denote "file type". It does not affect any functionality pe se. Secondly, "extension" only suggests some file type, but say little or nothing about actual content. For example, *.TIFF means TIFF container which can use no compression, lossy or lossless compression of different types. So, just forget about "extension". It's probably that you need some lossless algorithm, by I cannot be sure that you really need it, taking into account that with lossy algorithm you can get much smaller size without noticeable loss in visible quality.

Also, "resolution", in contrast to common belief, has nothing to do with the size of the image in pixel. Moreover, resolution, being a part of metadata does not affect the view of the image on screen, not at all. This is just the suggested default which can be used, for example, to print the image to "default" size in sm or inches.

It's not clear what "to minimal size" may mean. If you mean size of the image file in bytes, it should apparent, that you can reduce the size due to lossless compression, but not much. It's very important to understand that the "near-optimal" algorithm really depends on each individual image: for one, one algorithm with some set of parameters can be used, with different image, a different algorithm and parameter set can be better. You can experiment with different methods and choose the one which gives you better results, perhaps on image-to-image basis.

Please see:
http://en.wikipedia.org/wiki/Lossless_compression[^],
http://en.wikipedia.org/wiki/Data_compression[^],
http://en.wikipedia.org/wiki/Lossy_compression[^],
http://en.wikipedia.org/wiki/Data_compression[^].

You can experiment with the algorithms listed in the articles referenced above.

—SA


这篇关于改变图片扩展的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆