Simple Language Demos 

 

    Dummy Example
    This demo is a simple program describing the main elements that should be present in a script. Click `Edit Script` to see it.

     

    Using Comments
    Here we have shown the different kinds of comments that can be used in a script. Click `Edit Script` to see the syntax.

     

    "Hello World" Script
    This is a typical `Hello World!` script showing how to place text on the image and return it into the desired format, width and height.

     

    Functions Without Parameters
    This demo shows the syntax of function definitions and also function calling. Click `Edit Script` for details.

     

    Passing Parameters To Functions
    Functions called with parameters. Syntax. Parameters data types.

     

    Including Scripts
    Shows the capability of including other scripts into the source. Note that they should also have the `#version` directive.

     

    "If" Statement
    Shows the syntax of the `IF` statement and also a variety of conditional statements.

     

    Using Loops
    Shows the syntax of the 2 types of loops in the script language - `do while` and `while`.

     

    Variable Scopes
    Shows the difference between global and local variables, scopes and usage.

     

    Passing Params to Script
    If there are parameters passed to the script, e.g. some_script.img?amp;variable1=some_value&variable2=..., the script handles them as variables with names `param1`, `param2`, etc. Click `Edit Script` to see the source.

     

    Recursion (Calculating an Arithmetic Progression)
    Shows the recursion capabilities of the interpreter. There is a limit for the recursion depth set in the imagen.cfg file.

    Runtime Functions

       

      Text Operations
      This demo shows the different types of text alignment using the Imagen API for string operations and positioning.

       

      Image Loading
      Image loading is managed through the `load_image` function. A simple demo of the usage of this function is shown here.

       

      Image Result Functions
      You can set the output settings of an image -- JPEG ratio, transparent color, maximum number of colors used, etc.

       

      Filters #1
      This is an demo showing some of the filters that can be applied on images. The next two demos show the other filter types.

       

      Filters #2
      Image Filters - part 2

       

      Filters #3
      Image Filters - part 3

       

      Tile Image
      Images can be easily tiled on a custom selected rectangle with the `tile` function.

       

      Graphical Primitives
      The Imagen script language makes it possible to draw graphical primitives like circle, line, rectangle, ellipse. Also you can set the fill color and the border color.