Interlacer Workshop and Free Interlacer

Day And Night

To celebrate the release of the iPhone 4S, I will be joining Doctor Popular for an early morning Interlacer workshop. We will be in line at the Apple Store in downtown San Francisco. The workshop will start around 6:30 am.

In addition, Interlacer will be free on the App Store all day October 14th.

Come on down, have some coffee, and learn about creative ways to use Interlacer!

Interlacer 1.3 – Now With Postcards!

It’s a pleasure to announce that Interlacer version 1.3 is now available in the app store. Interlacer is proud to be a launch partner with the Sincerely Ship Library.

You can now send your photos as real printed postcards. This functionality is provided by Sincerely (the makers of Postagram and PopBooth), and the postcards have the same great quality you have come to expect from them. Sending a card is integrated into Interlacer, so you don’t have to open another app.

You can also send photos via email or send them directly to another app, like Instagram or Camera+.

This version also adds a much requested feature: auto-scale images. If you enable auto-scale, Interlacer will use the first image as the target size and automatically scale any additional images to the same size.

Interlacer is available now on the App Store.

If you are an iOS developer and would like to integrate printing into your own application, check out the Sincerely Ship Developer Page. The gang at Sincerely has made it very easy to add this feature to your app, and they are great people to work with.

Camera View Overlay in iOS

iOS 4 and higher allow for an overlay view to be added to the view hierarchy in the UIImagePickerController when it is in Camera mode. I wanted to use this technique in Interlacer to allow the user to line up multiple shots. It seemed that this would be very straightforward:

1
2
3
4
5
// assume there is an instance of UIImagePickerController* named picker...
// assume that there is a UIImage* property named overlayImage...
UIImageView *overlay = [[UIImageView alloc] initWithImage:self.overlayImage];
overlay.alpha = 0.5f;
picker.cameraOverlayView = overlay;

That code will show the image as a translucent overlay, but it is not lined up correctly in the viewfinder. The image was off by about 50 pixels. To make this work, I needed to resize the image to the correct viewfinder size, place that image in a UIImageView whose frame was the size of the main screen, then position the content (the resized image) at the top of the frame:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
// assume there is an instance of UIImagePickerController* named picker...
// assume that there is a UIImage* property named overlayImage...
UIImageView *overlay = [[UIImageView alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

// with an image sized to fit in the viewfinder window
// (Resize using Trevor Harmon's UIImage+ categories)
overlay.image =
            [self.overlayImage resizedImageWithContentMode:UIViewContentModeScaleAspectFill
                                                    bounds:CGSizeMake(320, 430)
                                       interpolationQuality:kCGInterpolationDefault];
// tell the view to put the image at the top, and make it translucent
overlay.contentMode = UIViewContentModeTop;            
overlay.alpha = 0.5f;
picker.cameraOverlayView = overlay;

This code is in an xcode project that demonstrates the overlay by allowing you to take a photo, then overlaying it in the camera view. You can find the code on github.

This fix will be in the next release of Interlacer.

Happy coding!

Adding EXIF Metadata To Images On The iPhone

EXIF metadata is embedded in most of the images created by digital cameras, and the iPhone is no exception. This can include information about the camera that made the photo, the software used to process it, the data and time, geolocation information, and many other pieces of interesting information.

When I was developing Interlacer, one of my goals was to include information about how the photo was created. Since Interlacer creates a new photo from multiple sources, the EXIF metadata block in the final image is missing. I didn’t want to just copy metadata from the source images, since there is no guarantee that the metadata in the source images would be relevant to the final image. I decided that I wanted to save the name and version of the app, some information about the source images that were used to create the final image, and the date and time the final image was created.

There are a lot of examples of how to manipulate the existing EXIF data in an image on the iPhone, but I didn’t find much information about how to add EXIF data to an image that did not contain any. The solution turned out to be quite straightforward. When an image is saved using the ALAssetsLibrary class, a dictionary of metadata can be included. This dictionary includes some basic metadata and can also include dictionaries of other metadata, such as EXIF and TIFF metadata. The keys for all these metadata values are constants declared in ImageIO/CGImageProperties.h.

Depending on the information you want to save, you may need several dictionaries, each containing a specific type of metadata. In Interlacer, the date and time and image dimensions are saved as EXIF metadata, and information about Interlacer and the source images is saved as TIFF metadata.

Here is the code showing how to create EXIF and TIFF dictionaries and save the information along with an image:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
- (void)saveImageAndAddMetadata:(UIImage *)image
{
    // Format the current date and time
    NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
    [formatter setDateFormat:@"yyyy:MM:dd HH:mm:ss"];
    NSString *now = [formatter stringFromDate:[NSDate date]];
    [formatter release];
   
    // Exif metadata dictionary
    // Includes date and time as well as image dimensions
    NSMutableDictionary *exifDictionary = [NSMutableDictionary dictionary];
    [exifDictionary setValue:now forKey:(NSString *)kCGImagePropertyExifDateTimeOriginal];
    [exifDictionary setValue:now forKey:(NSString *)kCGImagePropertyExifDateTimeDigitized];
    [exifDictionary setValue:[NSNumber numberWithFloat:image.size.width] forKey:(NSString *)kCGImagePropertyExifPixelXDimension];
    [exifDictionary setValue:[NSNumber numberWithFloat:image.size.height] forKey:(NSString *)kCGImagePropertyExifPixelYDimension];
   
    // Tiff metadata dictionary
    // Includes information about the application used to create the image
    // "Make" is the name of the app, "Model" is the version of the app
    NSMutableDictionary *tiffDictionary = [NSMutableDictionary dictionary];
    [tiffDictionary setValue:now forKey:(NSString *)kCGImagePropertyTIFFDateTime];
    [tiffDictionary setValue:@"Interlacer" forKey:(NSString *)kCGImagePropertyTIFFMake];
   
    NSString *version = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"];
    NSString *build = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"];
    [tiffDictionary setValue:[NSString stringWithFormat:@"%@ (%@)", version, build] forKey:(NSString *)kCGImagePropertyTIFFModel];
   
    // Image metadata dictionary
    // Includes image dimensions, as well as the EXIF and TIFF metadata
    NSMutableDictionary *dict = [NSMutableDictionary dictionary];
    [dict setValue:[NSNumber numberWithFloat:image.size.width] forKey:(NSString *)kCGImagePropertyPixelWidth];
    [dict setValue:[NSNumber numberWithFloat:image.size.height] forKey:(NSString *)kCGImagePropertyPixelHeight];
    [dict setValue:exifDictionary forKey:(NSString *)kCGImagePropertyExifDictionary];
    [dict setValue:tiffDictionary forKey:(NSString *)kCGImagePropertyTIFFDictionary];
   
    ALAssetsLibrary *al = [[ALAssetsLibrary alloc] init];
   
    [al writeImageToSavedPhotosAlbum:[image CGImage]
                            metadata:dict
                     completionBlock:^(NSURL *assetURL, NSError *error) {
                         if (error == nil) {
                             // notify user image was saved
                         } else {
                             // handle error
                         }
                     }];
   
    [al release];
}

Announcing Interlacer

My new iOS application, Interlacer, is now available in the App Store.

Interlacer is a photo application that combines multiple photos and/or colors into a new image. It does this by using alternating lines from each image and color. It is probably easier to illustrate with a picture:

You can take photos from within the application, select photos from your album, or select a color from the color picker. You can control the size of the lines and shift alternating lines to get a video interlace effect.

Two Is Spookier Than One

If you make any photos with Interlacer, feel free to add them to the Interlacer App Group on Flickr.

X of 365

My latest iOS application, X of 365, went live on the App Store yesterday. It is a simple application, designed to help with 365 photo projects by telling you the ordinal day of the year.

When the application starts, it displays the current date and which day of the year it is. You can change the date, or tap on the bottom half of the screen to bring up a menu. The menu will take you back to the current date, copy the text ‘x/365’ to the clipboard (where x is the ordinal day of the year), or show an About dialog. You can also shake the device to return to the current date.

It is a simple application, but I have found it very helpful when tweeting my daily mostly365 shots, and I have a few features planned for a future version that will make it even more useful for 365 projects. I wanted to give it a steampunk look and feel, and the graphic design by Olivier Zibret really does the trick.

The application is free, and can be found on the App Store. I have been using it on my own iPhone without issues, and it should work on any device with iOS 4.0 or higher. If you experience any issues with the app, please let me know.

Video Voice Mail

Yes, I waited in line yesterday morning for my iPhone 4. And again in the evening to get my wife’s iPhone 4. Was it worth it? Absolutely!

The display is stunning. I know you have probably heard this a million times by now, but really you have to see it. It is immediately obvious. The text renders amazingly crisp and sharp. It’s really beautiful.

Another feature that some people are excited about is FaceTime, which is basically videoconferencing over WiFi. After playing with FaceTime for a bit, it struck me that this would be a really cool thing to integrate into Visual Voicemail. What if you could leave a video message for someone rather than just voice? What if the video appeared right alongside the other messages in your Visual Voicemail screen?

I think we will probably see something like this in the not-too-distant future. What do you think? Is this something you would use?

iPhone 4.0 Wishlist

If you follow any tech blogs, you have probably seen the news that Apple is hosting an event on Thursday that is billed as “a sneak peek into the future of iPhone OS”. Of course, there is much wild speculation about what this might mean, with predictions of multi-tasking abounding.

First, please stop saying that the iPhone OS does not multi-task. Yes, it does. It has from the beginning. Ever wondered why your phone can check mail and play music and sync your calendars while you are playing a game? Ah, I see the light of realization dawning in your eyes! “But, why can’t I listen to Pandora while I am in Safari then?”, you ask. Simple. The ability to run apps in the background (multi-task), is not available to third party developers.

The non-ability of apps to run in the background has probably been the number one criticized point about the iPhone, and now the iPad. But why is this? Personally, this is not one of the things that really bothers me about the iPhone. It would be nice to have the option to listen to Pandora when doing other things, and to set alarms in my own iPhone app, but it’s not my number one most wanted feature.

My number one, most wanted, must have feature for the iPhone is:

Allow me to set custom sounds for incoming SMS messages!

I follow a lot of people on Twitter. I get literally hundreds of SMS messages every day. Because of this high volume, I keep my phone on silent mode. It would be very, very helpful to be able to set SMS messages from Twitter to vibrate, but messages from other people to use an audio alert. And not just those same old alerts that we have had since OS 1.0. Those have become stale. I want to use my own sounds for SMS alerts.

So Apple, if you are listening, how about it? Can we please get custom, assignable SMS alerts for iPhone OS 4.0? Pretty please?

How about you, readers? What is your number one most wanted feature for the iPhone?