jpeg 到 png 转换
我正在 iPhone 上处理图像。有很多 jpeg 图像,范围从 35kb 到 50kb。我可能需要通过互联网传输此文件,大小约为 6 MB。我尝试将 35kb jpeg 图像更改为 png。实际大小增加了 jpeg 为 56.1kb,png 为 576 kb。我用mspaint来改变格式。 jpeg 到 png 实际上应该减小图像的大小,对吗?如果不是,那么在 iphone 上拥有 jpeg 文件还是像典型的移动应用程序那样只有 png 文件是理想的选择吗?
I am working on images in iPhone. There are lots of jpeg images which range from 35kb to 50kb. I may need to transfer this over internet which comes around 6 mb. I tried to change a 35kb jpeg image to png. The actual size got increase jpeg was 56.1kb and png is 576 kb. I used mspaint to change the format. jpeg to png should actually decrease the size of the image right ? If no is that ideal to have jpeg files on iphone or only png like typical mobile applications have ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
JPEG 和 PNG 是非常不同的文件格式;任何给定的图像在一个图像中较小,在另一个图像中可能不会更小。此外,它们的质量无法直接比较。
例如,摄影内容可以很好地以 JPEG 形式表示。由模式识别组成的块细分形成了一种能够很好地以人眼不易注意到的方式丢弃视觉信息的格式。当然,高度压缩的 JPEG 可能会丢弃太多信息并显示块并立即打破照相现实的幻觉,但如果仔细使用,JPEG 对于“现实世界”的照片来说非常有用。
计算机生成的内容在 PNG 中得到了很好的体现。无损编码非常适合显示标准计算机生成的显示器的直线,并且简单创建的渐变可以用 PNG 精确复制。如果 JPEG 用于直线或简单的渐变,其缺点就会立即显现出来。此外,由于 PNG 可以基于调色板,因此它可以非常有效地存储只有几十种颜色的图像。
因此,请根据用途选择文件格式:JPEG 用于现实照片或非常接近现实的照片,PNG 用于计算机生成的内容。
JPEG and PNG are very different file formats; any given image that is smaller in one may not be smaller in another. And furthermore, their quality is not directly comparable.
For example, photographic content is very well represented in JPEG. The subdivision-of-blocks composed with pattern recognition makes for a format that does a very good job of discarding visual information in a way that human eyes do not easily notice. Of course, a highly-compressed JPEG may throw away too much information and show the blocks and instantly break the illusion of photographic reality, but used carefully, JPEG is fantastic for photos of the 'real world'.
And computer-generated content is very well represented in PNG. The lossless encoding is great for showing the straight lines of standard computer-generated displays, and naively-created gradients are replicated exactly with PNG. Had JPEG been used for either straight lines or naive gradients, the shortcomings would stand out instantly. Also, because PNG can be palette-based, it can very efficiently store images with only a few dozen colors.
So, pick the file format based on its use: JPEG for photos of reality or for very good approximations of reality, and PNG for computer-generated content.
如果 PNG 文件的内容是图形并且包含许多颜色均匀的形状,则 PNG 文件通常较小。对于照片或扫描,jpeg 文件要小得多,因为它们使用更复杂但有损的压缩算法。
对于您的 iPhone 项目,您应该使用较小的值,在您的情况下为 jpeg。
PNG files are usually smaller if their contents are graphical and contain a lot of evenly colored shapes. For photos or scans jpeg files are way smaller, since they use a much more sophisticated, yet lossy, algorithm for compression.
For your iPhone project you should use whatever is smaller, in your case jpeg.