使用霍夫曼编码压缩iPhone相机拍摄的图像 [英] Using Huffman coding to compress images taken by the iPhone camera

查看:151
本文介绍了使用霍夫曼编码压缩iPhone相机拍摄的图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在考虑使用霍夫曼编码来制作一款可以直接从iPhone相机拍摄并压缩它的应用程序。硬件是否可以处理复杂的计算并构建树?换句话说,它可行吗?

Im thinking to use the Huffman coding to make an app that takes pictures right from the iPhone camera and compress it. Would it be possible for the hardware to handle the complex computation and building the tree ? In other words, is it doable?

谢谢

推荐答案

如果你的意思是图像文件(如jpg,png等),那么你应该知道它们已经被特定于图像的算法压缩了。如果有的话,生成的文件不会对huffman压缩太多。

If you mean the image files (like jpg, png, etc), then you should know that they are already compressed with algorithms specific to images. The resulting files would not huffman compress much, if at all.

如果你的意思是你要获取UIImage原始像素数据并压缩它,你可以这样做。我确信iPhone可以处理它。

If you mean that you are going to take the UIImage raw pixel data and compress it, you could do that. I am sure that the iPhone could handle it.

如果这是一个有趣的项目,那就去吧。如果你想让它成为一个有用的和使用过的应用程序,你将面临一些挑战

If this is for a fun project, then go for it. If you want this to be a useful and used app, you will have some challenges


  1. Huffman不大可能是优于JPG,PNG等中使用的标准图像压缩。

  1. It is very unlikely that Huffman will be better than the standard image compression used in JPG, PNG, etc.

Apple已经看到需要更好的压缩并在iOS 11中实现HEIF。关于HEIF的WWDC视频

Apple has already seen a need for better compression and implemented HEIF in iOS 11. WWDC Video about HEIF

他们在操作系统和照片应用程序中做了很多工作,以确保在本地使用HEIF,但如果你分享照片,它会把它变成任何人都可以使用的东西(例如JPG)

They did a lot of work in the OS and Photos app to make sure to use HEIF locally, but if you share the photo it turns it into something anyone could use (e.g. JPG)

它们实施的所有压缩都使用硬件加速。你也可以这样做,但代码比Huffman要难得多。

All of the compression they implement uses hardware acceleration. You could do this too, but the code is a lot harder than Huffman.

所以,为了学习和娱乐,这是一个很好的项目 - 作为Mac应用程序可能更容易做,但对于一些真实的东西,要克服上述问题将非常困难。

So, for learning and fun, it's a good project -- it might be easier to do as a Mac app instead, but for something meant to be real, it would be extremely hard to overcome the above issues.

这篇关于使用霍夫曼编码压缩iPhone相机拍摄的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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