Image viewer without smoothing - iphone

How to create an image viewer for iOS which doesn't do image smoothing when zooming? Like the image viewer of Screenshots Journal.

If you have a NSGraphicsContext in which your drawing takes place, you can call [-NSGraphicsContext setShouldAntialias:NO].

Related

UIImagePickerController capture full screen on iphone

I'm using UIImagePickerController class to capture image from camera.
When is captured, I save the picture on disk. After that I use imageWithContentsOfFile method to load this image as background of the main screen.
The problem is that when I load the picture appears 2 white bands on top & bottom of the view.
My question is how can I take a picture with 320X480px of size in order to load it full screen?
Thanks.
--EDIT--
The originalImage when is captured sizes this:
INFO -> Captured Image Size W:480.000000 H:640.000000
How can I get the image directly 320X480px?
Thanks.
Presumably you get white bands because you've got the content mode of the UIImageView you're displaying it in set to UIViewContentModeAspectFit which means resize the image, maintaining aspect so that it you can see the entire image. If you set the content mode to UIViewContentModeAspectFill it'll do what you want.
The reason for this discrepancy is that the aspect ratio of the screen (2:3) is not the same as the aspect ratio of the images that come from the camera (3:4).

Glass lozenge distortion on iPhone

Is it possible to use the image distortion called "Glass Lozenge" which is available as part of core image on the iPhone to distort an image? If you don't know what I mean just open core image funhouse.

How do you use OpenGLES to open an image file, do some work, then save the image file, in the background (offline)?

So I'd like to create a class that accepts a CGImage from an image file I just read from disk, does work on that image texture (color transformations) then returns the texture as a CGImage and does all this in the background w/out drawing to screen. I've looked at Apple's demo app on GLImageProcessing but it draws all the processing to the screen and I've seen bits and bites of how to do parts of what I want but can't assemble it.
Any suggestions would be greatly appreciated.
Thanks
You will have to use Framebuffer Objects (FBOs) to draw offscreen, but you still need a GL rendering context.

Show photo with SCRATCH OUT EFFECT by finger

I need your help to know how to create an iPhone application to show a photo with SCRATCH OUT EFFECT.
Something like the effect in this flash tutorial
http://www.tutorial5.com/content/view/115/46/
Please help.
Thanks.
You can have a look at the following post on how to create a blurred image effect, I don't think it's the best & fasted method, but it might get you started:
UIImage blur
You can implement the scratch out effect by using CoreGraphics.
Subclass UIView for the scratchable image.
Draw the scratchable image, use a mask to cut out the parts of the image that gets "scratched".
Each time the user scratches the image, make it so the mask and the image gets updated.
Full code example on github

iPhone - save image at higher resolution without pixelating it

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).
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?
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.
Thanks
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).
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.
From faint memories of computer vision class from long ago, I think what you do is to blur the image after the up-convert.
Before drawing try adjusting your CGBitmapContext's antialiasing and/or interpolation quality:
CGContextSetShouldAntialias( context, 1 == 1 )
CGContextSetInterpolationQuality( context, kCGInterpolationHigh ) ;
If I remember right, antialiasing is turned off on CGContext by default.