This tutorial assumes... I suppose intermediate level of proficiency with Photoshop? I am using CS4 so a lot of the instructions are going to be specific to that; however, if you're familiar enough with a different image-editing software I'm sure the basic principles can be adapted well enough. For example I know, since I've used it before, that Photoshop Elements is lacking a lot of the tools--such as the animation panel--which make this process faster, but it's still doable with Elements, if a bit more annoying. Okay, a lot more annoying. Anyway.
Part I: Preliminary Stuff
First what we're going to do is we're going to acquire our clip. Do it however you like; the
1-click youtube video download plugin for firefox is pretty handy if you need something like that.
For today's example, we are using this clip:
...which is... none too pretty, so far as iconning goes--the "camera" is wobbly, the colors are a little jittery (which is okay to look at but terrible for file size), and there's some tinpot asshole fidgeting around doing nothing much very exciting in the background.
So! The first order of business is to get the frames lined up relative to the background (Steiner aside). If you're dealing with animated clips, this is only occasionally necessary (like with this one); with actual-meatspace-filmed clips, it's almost always necessary. Anyway, this gives us the following:
...okay, a little better, but still definitely not ideal. Really the only thing we've done is mitigated the first issue a little bit; notice that even with that, there's still some perspectivey wobbling going on there. But! Not a problem! Because what we're going to do now is we're going to cobble together a clean background still.
Part II: Background Clean-up
This can sometimes be tricky! Sometimes there's bits of background that you never actually see at all. This is usually okay because they'll most likely be covered up in the end product anyway--all we're looking to do is to give a bit of a baseline that won't look weird if our handling of the foreground stuff isn't 100% perfect. That said, this is one of the few cases where it wouldn't be okay, because, of course, we want to get rid of Steiner, who fucks with the looping kind of a lot. Normally, this is where I'd buckle down to do some serious redrawing. However, fortunately, earlier in the same scene we get some good, clear views from the same angle of the things that get covered up by Zidane and Steiner in the target clip:
So, what I've done is I've made a group containing those two with an additional third still copied from the ones we're using to animate, in the following fashion:
{There was an illustration that was supposed to be here but pics.lj is being an ass. pls hold while I spend the next however-long trying to convince it to cooperate.
[EDIT] fuck this noise I'll try again later when lj feels like being less asslike. It's not that crucial an illustration anyway.}
Starting from the lowest layer, I've masked* out all of the moving elements in each still, taking care to cover shadows as well as solid figures. I then harmonic-seriesed the opacity from bottom to top (that is to say, for each frame number i where the lowest layer is i=1, the opacity of that layer is equal to 1/i, or as close as whole numbers will allow: the lowest layer is 100% visible, the second is 50% visible, the third is 33% visible, and so on). This smooths out any compression ugliness--which actually isn't too big of a problem with this clip, but sometimes it can get pretty bad. After that, I duplicated the whole group, merged that entire group into one layer, and then duplicated/merged down that layer a few times until I was sure the entire thing was opaque.
* ...and if you don't know what masking is, uh, see the first pic with the menus in part III below, because I am shit at planning these sorts of things. The mask layer is the little black and/or white one that appears to the right of the little chainlink if you select any of those four options.
The end result looks like this:
The gears at bottom are a little fuzzy and also you can kind of see a ghostly speech bubble above the black mage at left, but that's okay because they'll both be well out of shot in the final crop of this icon. At this point you can make this layer the document background if you like, which you'll probably want to do anyway eventually. You can now hide the original background group, though I don't recommend deleting it in case you want to make changes later.
Part III: Foreground Clean-up
Now, on to the foreground! Before you do anything else at this point, you might want to put each movement layer in its own individual group: later on you might want to modify individual frames in ways that require multiple layers, and it's so much easier to handle the animation group-by-group rather than layer-by-layer.
So, with that done! Here comes the tedious part.
Start with the first still from the animation clip and lasso-select every single moving element you want to appear in that frame. Again, don't forget shadows if there are any. The selection doesn't have to be perfect at this point because we'll be refining it later. Now go to Layer → Layer Mask → Reveal Selection, like so:
And you can see the lovely background! ...which, generally, shouldn't look too different from the background you started with, removable elements like Steiner aside. At this point you can go through and refine the layer mask with a brush. I recommend making a color fill layer at low opacity between the background and foreground layers in some color that isn't very prevalent in the scene so you can actually tell what the heck you're even doing:
This is actually a different frame entirely because I'm a winner and forgot to cap the other one.
Refine in as much detail as your patience allows. After you've done with that frame, go to the menu and hit Window → Animation. In the window that appears, hit the new frame icon, which looks exactly like the new layer icon. Working on the new frame, hide the group containing the previous foreground elements and reveal the group that follows it. Now do the previous steps of Part III over and over until you're out of movement stills.
Word of caution! Anything you do regarding visibility, position, or transparency on the first frame happens to all the other frames. Anything you do regarding the same on any other frame only happens on that frame. So if you move something on frame three and then move the same thing on frame one, it'll be shifted again on frame three. Keep this in mind when you're moving shit around. This, by the way, is the rest of the reason why we put every motion still in its own folder a few paragraphs back.
Eventually, we arrive at this:
...Which is finally something workable! The background is nice and steady, Steiner is gone*, and generally the only things visible or moving are the things we want to be visible or moving.
* Advanced note: if you have a clip where you have two or more figures and you don't want to delete all but one, you can also animate each figure separately in the event that their looping doesn't play well together. That is, do everything else in this tutorial as written but do part III for each figure. In the final loop, you can repeat, remove, or otherwise fuck around with the individual figure stills as necessary so that everything matches up.
Part IV: Final Touch-ups and Saving
So now all that remains is final adjustments, cropping and saving! Usually I put a levels adjustment layer above everything and smart blur or surface blur or whatever as necessary. After you've done all that, if you haven't merged the background yet, do that now. Crop the image--but you don't have to resize it, because you can just go File → Save for Web & Devices, and the nice thing about the "save for web" thing is that you can resize right there in the dialog box, circled in blue below! Yeah. Oh, and make sure the second from top box there says "GIF"--sometimes I frustrate myself for ages going WHY WON'T IT SHOW THE ANIMATION OPTIONS when I have it set as, like, JPEG or something. Like a winner. Anyway.
...this is just the rightmost side of the box, since most of the important stuff is here and the rest is mostly a hueg preview space.
Okay, so about saving: livejournal has a 40kb size limit for icons. Nine times out of ten when making animated icons, I overshoot this limit to begin with. That's okay! There are a few things that you can change about an animated icon which contribute to the filesize of an animated gif:
- Amount of movement, such as:
- Number of frames. This is pretty self-explanatory. Often, removing even just a single frame is the fastest way to decrease the filesize at the end. You can, of course, cull frames at any time in the process--doing it earlier means you save the work of having to edit frames you don't use, but doing it later means that if you're doing something more complicated than what I've described here, it's easier to stay consistent between frame if you later decide that you want to add another one (which does happen to me sometimes).
- Amount of individual pixel change between frames. This is the reason why, even in an icon where you're not trying to get rid of Steiner or similar, it's still a good idea to do the whole background replacement thing--it saves space. Even though it may be hard to pick out the subtle jittering by eye depending on monitor settings and visual acuity, even the most minute change in the color of an individual pixel costs a little bit of space that a constant color doesn't.
- Amount of detail per frame, such as:
- Noise/texture. This is a problem especially if the file you grabbed your stills from was kind of lossy and gross to begin with. I like to use either smart blur or surface blur to deal with this, at least to begin with--the former sometimes does weird things with the edges while the latter sometimes does weird things with the colors, so pick your poison. Sometimes you still have to do some serious redrawing even after using filters.
- Color usage. This is usually my first resort, because you can lose a certain number of colors to save a decent amount of space before it starts being too noticeable, but past that point it'll start to look really shitty really fast so it's also usually not the only thing I end up doing. Thankfully, you can edit it right in the dialog box--circled in red above--just feel around with how many colors are used until you get something nicely in the 39.xx range. Usually I can manage within 39.8x or 39.9x. The box right next to it circled in green, right now set as "perceptual", determines how the colors are selected--sometimes the filesize changes depending on which selection you use. The look definitely changes depending on which you use. Try all of them and see which one works best for the particular icon. Also, keep "transparency" checked, because for some reason it decreases the filesize--like, it reserves a color for "transparent" but somehow the same gif in 80 colors with transparency is smaller than in 79 colors without. IDK why.
- Contrast. If you increase the contrast a little--I like to do this with levels because it gives more fine-detailed control--it'll usually make the overall file size smaller. The actual reason for this kind of goes with both of the above--you're decreasing the distinct number of levels of brightness, and you're also bottoming out some of the details in the shadows and highlights. Again, the easiest way to do this is just to slap an adjustment layer over the top of everything, because that way you don't have to edit every individual still.
Our finished product looks like this:
...so other than cropping, since the last full shot* I've also messed with the levels so it's smaller and prettier and cut out a few frames to allow for more colors and speed up/smooth out the loop a bit.
* The examples were all at 50% working dimensions to save the loadtime of this tutorial. In case you were, uh, wondering how the crop is a teensy bit more zoomed in than the full version.
So yeah! That's it |Da