)
                 )
                 (theText)     ;a declaration for the text
                               ;we create later
      

Note: We used the value RGB to specify that the image is an RGB image. We could have also used 0, but RGB is more descriptive when we glance at the code.

You should also notice that we took the head of the result of the function call. This may seem strange, because the database explicitly tells us that it returns only one value — the ID of the newly created image. However, all GIMP functions return a list, even if there is only one element in the list (apparently because someone is insane), so we need to get the head of the list.

3.5.2. Adding A New Layer To The Image

Now that we have an image, we need to add a layer to it. We'll call the gimp-layer-new function to create the layer, passing in the ID of the image we just created. (From now on, instead of listing the complete function, we'll only list the lines we're adding to it. You can see the complete script here.) Because we've declared all of the local variables we'll use, we'll also close the parentheses marking the end of our variable declarations:

        ;create a new layer for the image:
           (theLayer
                     (car