Tuesday, May 14, 2013

How to Create a gif animation in Photoshop cs6

This will work with most recent versions of Photoshop but I am using CS6 so if you are using a different version, there might be some discrepancy. I am creating an animation using several pictures taken at different times from the same location and orientation to effectively setup a time lapse.

1) Create a computer folder and put all the images you wish to turn into gif in there.

2) Run the command "File > Scripts > Load Files into Stack". This will open up a window where you can select all the images you wish to use. Bring them in as new layers for each image.

3) Order the images the way you want.

4) The photos you took might not all be perfectly alligned so you might have to move them around a bit. The easiest way to do this is the following. First "Image > Canvas Size" and increase the size by about 50%.

5) Hold down the shift key and select all but the bottom layer on the right side. Then right above the layers, change the opacity to about 40%. Then click "Layer > Hide Layers" to hide all the images for now.

6) With this setup, you should see only the last picture. You can now select any one other image and either click "Layer > Show Layers" or just click on the little square next to each layer to turn on the eye icon. With that layer selected, pick a center point that you would like to use on your images and line up the two visible images to that point. When this image is set, hide it and show the next one. Repeat until done.

7) Now you want to do some cleanup and get rid of all the empty space that you created around your images. Select the rectangle Marque tool (m) which is the second from the top left and create a square in which every image completely overlaps. Click "Image > Crop" to clear out the empty space

8) With the images lined up properly, you can select them all again, show them all and turn the opacity back to 100%.

9) Now to actually make the gif. Click on "Window > Timeline" to open up... the timeline window.

10) In the top right corner of the new window, there should be a little set of horizontal bars, click on that and select "Make Frames From Layers".

11) Under each frame there is a duration, you can select all or each frame and change that duration to whatever you want. You can hit the play button on the bottom to see the result.

12) When you are happy with how it is setup, click "File > Save For Web...". There are lots of other options there but all you need to make sure of is that it is a gif and then save it. Done!

If you would like to read another yet similar way of doing this, you can follow this link.
http://www.briandalessandro.com/blog/create-an-animated-gif-in-photoshop-cs5/





Thursday, May 2, 2013

iOS Creating Custom Delegates in iOS6 with ARC

So you want two Objects to talk to each other more than a little bit? Here is what to do by example.  Lets say we have our MainViewController and a new SearchViewController that you want a delegate attached to it. This is all you need to do.

In SearchViewController.h
@protocol SearchViewDelegate <NSObject>
@optional
@required
-(void)didAskToSearch:(NSString*)string;
@end

@interface SearchViewController : UIViewController {
}
@property (nonatomic, assign) id <SearchViewDelegate> delegate;
@end

optional has non-required methods and required of course has required methods. 

In SearchViewController.m;
    [_delegate didAskToSearch: [self searchRequestDetails]];

this is put anywhere in the code when you want it to send the information back to the other object. 

In the MainViewController.h;
@interface MainViewController : UIViewController <SearchViewDelegate> {
}

In MainViewController.m;
SearchViewController *searcher = [[SearchViewController alloc]init];
searcher.delegate = self;

#pragma mark - SearchViewControllerDelegates
-(void)didAskToSearch:(NSString*)string{
     //do whatever you want with the string results
}

When creating the object, make sure the tell the delegate you have those methods. Then you just have to create the methods as per it is required. 

Helpful link
http://stackoverflow.com/questions/12020539/how-to-make-custom-delegate-in-ios-app