iPhone - 以更高的分辨率保存图像,无需像素化 [英] iPhone - save image at higher resolution without pixelating it
问题描述
我正在使用图像选择器控制器从用户那里获取图像。在对图像进行一些操作之后,我希望用户能够以1600x1200像素,1024x1024像素或640x480像素(类似于iFlashReady应用程序)保存图像。
I am using the image picker controller to get an image from the user. After some operations on the image, I want the user to be able to save the image at 1600x1200 px, 1024x1024 px or 640x480 px (something like iFlashReady app).
最后一个选项是我在UIImagePickerControllerDelegate方法中获得的图像大小(当使用来自相机胶卷的图像时)
The last option is the size of image I get in the UIImagePickerControllerDelegate method (when using image from camera roll)
我们有什么办法可以在没有像素化的情况下以这些分辨率保存图像图像?
Is there any way we can save the image at these resolutions without pixelating the images?
我尝试创建一个具有我想要的宽度和高度的位图上下文(CGBitmapContextCreate)并在那里绘制图像。但是图像在1600x1200处被像素化。
I tried creating a bitmap context with the width and height I want (CGBitmapContextCreate) and drawing the image there. But the image gets pixelated at 1600x1200.
谢谢
推荐答案
这个是非平凡的。您的图片没有足够的数据。要放大它,您需要对图像进行重新取样并在像素之间进行插值(如调整图像大小时的Photoshop)。
This is non-trivial. Your image just doesn't have enough data. To enlarge it you'll need to resample the image and interpolate between pixels (like photoshop when you resize an image).
很可能你会想要使用第3个像素派对图书馆如:
Most likely you'll want to use a 3rd party library such as:
http://code.google.com/p/simple-iphone-image-processing/
执行此操作以及许多其他图像处理函数。
This performs this and many other image processing functions.
这篇关于iPhone - 以更高的分辨率保存图像,无需像素化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!