GIMP tricks: Rotating Sphere with GAP

[ 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.

Author: noss

Below is an example of what you should achieve after completing this howto. Nice isn’t it? :P

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:

  1. 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.
  2. Download the following pattern (a grid: )
  3. 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.

  4. 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.

  5. 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:

  6. 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.

  7. Select the background layer and from context menu choose “Add Alpha Channel”.

  8. Use filter: “Filters” > “Filter all Layers…”
  9. 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.

  10. 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.

  11. Leav the next two tabs unchanged unless you want to make some experiments :)
  12. Now select the last tab – “Orientation” and set the Z “Rotation” to 50, and click “OK”.

  13. There should appear a small window. Click “Continue”. This takes you back to the previous window “Map to Object”.

  14. 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.
  15. 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.

  16. Check the animation. “Filters” > “Animation” > “Playback”

  17. 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:


Possible modifications:

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.

  1. 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:
    1. 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”.
    2. Use: “Filters” > “Animation” > “Optimize (for GIF)”
    3. 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).

  2. 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.

    A.

    B.

    Here additionally I increased the value of the Z “Orientation”.

  3. 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!

Creative Commons License
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.

Subscribe to RSS feed for this article!

2 Comments

fold this thread E. la Roy  Monday, 6 August 2007 o godz. 5:10 pm #  Add karma Subtract karma  +0

Thanks, I made this with a screenshot of Flash Earth.

(Comments wont nest below this level)
 
fold this thread Aida  Friday, 29 June 2012 o godz. 1:13 pm #  Add karma Subtract karma  +0

his article is very nice understanding the patients is very important from this i understood everything thank you.http://www.expectaculo.com

(Comments wont nest below this level)
 
Name (required)
E-mail (required - never shown publicly)
URI

Adjust field size: shrink | enlarge)


You can use simple HTML in your comments. Some examples are as follows:
  • A hyperlink: <a href="polishlinux.org">GNU/Linux for everyone!</a>,
  • Strong text: <strong>Strong text</strong>,
  • Italic text: <em>italic text</em>,
  • Strike: <strike>strike</strike>,
  • Code: <code>printf("hello world");</code>,
  • Block quote: <blockquote>Block quote</blockquote>

About the Author

Dominik Sarnowski

New AdTaily ads!

Are you a film buff?

film buffs community, movie recommendations and reviews

RSS: Comments

You can follow the comments to this article through a special channel RSS 2.0 .

Related articles: Graphics

 more »

PolishLinux Top Content


Become our fan on Facebook!

PolishLinux.org on Facebook

Follow PolishLinux on Twitter!

Follow polishlinux on Twitter

Google Ads