[ Thursday, 28 June 2007, titter ]
This article shows how to create an rotating sphere in GIMP with GAP plugin. Basic knowledge of this graphics manipulation suite will be required to successfully follow the tutorial.
Below is an example of what you should achieve after completing this howto. Nice isn’t it?
WARNING! This effect can’t be obtained with an unstable version of GIMP (2.3.*) because GAP doesn’t work with it correctly.
If you don’t know the GIMP suite or you aren’t familiar with the terms used in graphics manipulation check out a few tutorials for beginners before starting with this one.
It is necessary to install a special package called GIMP Animation Package (GAP). Don’t forget about a very important GTK+ library! You can download these things from the official mirror.
Follow the 17 easy steps to get the Sphere:
- Create a new image. Set its size to 200x200px. Set background color to black. The size can be different but it has to be a square, not a rectangle.
- Download the following pattern (a grid: )
- Open the downloaded image in GIMP and use a proper script from the menu: “Script-Fu” > “Selection” > “To Pattern…” to create a pattern basing on it.
- In the window type twice the name you want to give to a pattern, e.g. “my-grid”.
Now your pattern should be in the Patterns menu. Unfortunately this pattern is whole white and that is not so easy to find. You have to locate it by searching for the name you gave to it.
Of course you can use any of the available patterns in GIMP or even create your own. Whatever you choose will not affect the rest of this tutorial.
- Now return to the image with the black background. Fill it with the pattern you just created (“my-grid” or other) by dragging it onto your image. The effect you see should look like this:
- Duplicate 11 (eleven) times the background of the image so that you will have 12 identical layers. The number of layers can be different of course. Some of animations look good using only 8 layers, but generally speaking, the more layers the smoother the animation is. But — don’t create too many of them because there is also the rule saying “the more layers the slower GIMP renders them”. With 100 layers you could easily order pizza wait for it and eat it and maybe even have a nap.
- Select the background layer and from context menu choose “Add Alpha Channel”.
- Use filter: “Filters” > “Filter all Layers…”
- Now select a filter for the animation. What you are looking for is “plug-in-map-object”. In “Search” edit box type “map” and click the “Search by Name” button. Choose the plugin from the list and click the “Apply Varying” button.
- In the “Map to Object” window select from the “Map to:” list the “Sphere” (in general options). Check the “Transparent background” and enable anti-aliasing and set “Depth” to 3.
- Leav the next two tabs unchanged unless you want to make some experiments
- Now select the last tab – “Orientation” and set the Z “Rotation” to 50, and click “OK”.
- There should appear a small window. Click “Continue”. This takes you back to the previous window “Map to Object”.
- Select the “Orientation” tab again. Now set the Y “Rotation” to e.g. 50. Here you have to try to adjust the rotation so that the animation is smooth and there are no skipped frames. In this example all parameters are well-matched and you can just type what you are told. But still feel free to make some experiments. If you have changed the size of the image you probably will have to experiment with the value anyway. You can try to set the light to achieve an extra effect of a sliding light.
- Now click “OK”. In the window that appear next click “Continue” and wait. The GIMP will prepare the animation using all layers in the file. It can take several seconds depending on the number of layers and your PC speed.
- Check the animation. “Filters” > “Animation” > “Playback”
- If you have checked the animation, and it looks good, save it. “File” > “Save as…”. Change the file type to GIF, set the name and click “Save” button.
Now check the radio button “Save as Animation” and click “Export” button.
On the following window there change “Frame disposal where unspecified” to “One frame per layer (replace)” and click “OK”.
It’s done! The file, if you didn’t alter the parameters anything, should contain the following animation:
Generally the number of modifications is almost infinite, so trying to describe them all is impossible and would take too much time and space (infinite space to be exact). But still we are going to give you some further hints.
- Size optimization: In this particular case there is a possibility of optimizing your animation that it will take less HDD space. To use the optimization you have to skip the last step of the main tutorial and do the following:
- Manually index your animation: “Image” > “Mode” > “Indexed”. In the “Indexed Color Conversion” window decrease “Maximum number of colors” from 255 to 64, and disable dithering by selecting “None” in the “Color dithering” list. Click “OK”.
- Use: “Filters” > “Animation” > “Optimize (for GIF)”
- Save the new image just like it was in the 17th step. But now change “Frame disposal…” to “Cumulative Layers (Combine)”. It is because all layers are combined.
The effect of this actions is that you get the same animation but with reduced number of color which shouldn’t matter in this kind of the animation anyway. What you can notice is that the file containing the animation is smaller (85KB > 51KB).
- Pattern modification: In the 5th step, instead of filling the black layer with the pattern, fill the transparent one. To do this you have to create an image with a transparent background before. And then follow next steps without any changes. In the “B” example I created a white layer for every layer of the animation and merged them together.
Here additionally I increased the value of the Z “Orientation”.
- And here are some more modifications of the pattern from the 4th step and settings from the “Map to Object” window.
Feel free to send you own modifications and leave comments about further optimizations of the rotating sphere!
This work is licensed under a Creative Commons License.
This article has been first published in Gimpuj.info, a Polish online GIMP forum. You can see the original tutorial (in Polish) here: Wirująca kula z GAP. The article has been slightly modified compared with the original version by the PolishLinux team.