Short Description

Python engine for Icy, based on Jython

Team: Bio Image Analysis
Institution: Institut Pasteur


The Jython for Icy plugin allows you to write scripts for Icy in the Python language. Scripts can be used to automate processing tasks (the Protocols are another kind of automation tools, where the script is defined graphically).

About Python

Python is a powerful dynamic programming language, that aims to be elegant, powerful and uncomplicated. Some of its key distinguishing features include:

  • very clear, readable syntax
  • strong introspection capabilities
  • intuitive object orientation
  • natural expression of procedural code
  • modularity
  • very high level dynamic data types
  • extensive standard libraries and third party modules for virtually every task

Inside Icy, Python is a great and easy-to-learn language to write down your image processing scripts.

About Jython

Jython is an implementation of the Python programming language for Java. Icy itself is precisely written in Java, so Jython is a natural choice as a scripting engine for Icy.

Please note that there is one major difference between Jython and CPython (the standard implementation of Python in the C programming language): some libraries are designed to run specifically in CPython, and they cannot run directly in Jython. The well-known numerical libraries Numpy and Scipy belong to this category, and will not work directly inside Icy. We are working in an elegant way to use them by bridging CPython and Jython. Stay tuned !


The Python scripting engine will appear when you open the Script Editor. The first time you open the Script Editor after having installed Jython for Icy, the application may freeze for some time: Jython is going over all of the source code of Icy and its libraries to make them accessible in Python.

Script Editor icon in Icy toolbar

Choose Python in the drop-down list of the editor window.

Select python as the script language

You can write your Python script inside the editor’s text area and then run it by clicking on the “Play” icon.

Running a python script in Icy

In the above example, the script will duplicate the currently-active sequence.

You can also use the console at the bottom of the editor window to interact with Icy. Enter the command lines one-by-one in the text area at the very bottom of the window, and execute each line by hitting Enter.

Python console

In the above example, we asked for the width of the focused sequence (128 pixels), and we were about to ask for its height.

Resources needing this

One review on “Jython for Icy

Leave a Review

Leave a review
Cancel review
View full changelog
Close changelog


  • Version • Released on: 2022-11-18 14:00:00

    Implement the new PluginScriptFactory interface from Icy-Kernel 2.4.3 (used to solve issue with ScriptEngine and Java 15)

  • Version • Released on: 2020-10-16 11:00:00

    Bundled Python extractor plugin into Jython for Icy. It's easier to manage and make more sense (Stephane)

  • Version • Released on: 2020-07-23 15:30:00

    Moved PythonLibraries annotation to PythonExtractor, make more sense (Stephane)

  • Version • Released on: 2020-07-22 18:00:00

    Updated to single Jython plugin package again but using the old and weird weird 2.7b1+ version (not really the same as 2.7-b1, be careful) - Stephane

  • Version • Released on: 2020-02-24 14:00:00

    fixed dependency

  • Version • Released on: 2020-02-20 17:30:00

    Reverted to old version fo fix Aleix issue (Stephane).

  • Version • Released on: 2020-02-20 17:00:00

    Reverted Jython library to 2.7b1 as version 2.7.0 can introduce issues with execnet processes.

  • Version • Released on: 2020-01-09 12:00:00

    - updated to Jython 2.7.0 library
    - moved the full jython package into the plugin (making jython extras plugin obsolete)
    - moved pythonLib annotation to this plugin

  • Version • Released on: 2020-01-07 16:00:00

    removed update

  • Version • Released on: 2013-12-10 10:50:56

    Fix memory leaks when reloading plugins (after an update for example).

  • Version • Released on: 2013-11-18 13:04:56

    - Update to Jython 2.7b1 (from upstream repository on Bitbucket, commit 7b44ea13, dated 2013-11-18).

    - Fix so that the "site" module is always imported (essential for availability of all modules coming from plugins, or for user customization with

    - Deprecate the PythonLibraries annotation and remove all the code managing it. The annotation is now provided by the "Python Extractor" plugin, which does the extraction job in a more elegant way.

  • Version • Released on: 2013-11-05 14:14:42

    New mechanism to specify that a plugin contains Python files to export and to put in the Python path: the main Plugin class must now be annotated with "@PythonLibraries". The PythonLibrariesBundle interface that was used for the same goal is now removed. Annotations are better suited to this task.

    Also provides JythonLibsManager.addPluginsToPath() as a static method for future use.

  • Version • Released on: 2013-07-04 09:32:52

    Fix the handling of spaces in jar path.

  • Version • Released on: 2013-06-25 15:42:58

    Extract python library files to disk instead of loading from the jars. This improves the readability of backtraces. It also improves the compatibility with python libraries like execnet that play with the source files.

  • Version • Released on: 2013-02-28 14:29:10