Primawera is a simple image viewer allowing users to view image data of various formats. Beyond its basic viewing capabilities, Primawera empowers users with the ability to enhance their images using simple filters.

Using Primawera

Primawera can show many common image formats, including PNGs, JPGs, and TIFFs. Bellow a simple PNG was opened.

Fig default

In Primawera, users can easily zoom in or out on images by pressing the "+" or "-" keys, respectively. This zoom functionality allows users to magnify or reduce the image size by a factor of 2 with each press. However, it's important to note that the application does not permit zooming out beyond the original dimensions of the image.

Fig zoomed in

Sometimes the raw image has issues with its dynamic range. For this purpose Primawera allows the user to apply gamma correction and opens an auxiliary window, where the user can experiment with the right value for the gamma factor.

Fig gamma

Similarly, it is also possible to linearly stretch the pixels' values by multiplying them with a specified factor, but this is capped at the maximum value 255.

Fig stretch

Apart from color images, Primawera allows the user to view grayscale images, such as the one below. Moreover, the user can open an information panel, where basic metadata about the image and the values under the cursor are visible.

Fig grayscale

However, having everything in grayscale can be uninteresting or unhelpful; Primawera allows users to apply a LUT for these issues. Right now, the sepia LUT and jet LUT (similar to the one in matplotlib) is available.

Fig lut.

Finally, it is also possible to view floating point and complex data, which are automatically stretched to the [0, 255] range. This might be okay for some images, but for viewing the magnitude of the image in the frequency domain, logarithmical stretch is also available.

Fig pattern Fig complex

The next feature is the ability to overlay images on top of each other. In the image bellow the user applied a LUT and overlaid extra data on top of the left image, indicating where individual cells are.

Fig 3

The application can deal with grayscale, colored and floating point 3D image stacks with various bit depths. In the picture below, a 3D 16-bit grayscale TIFF image was opened. After applying the linear stretch filter, the structures are visible, and primawera provides orthonormal projections of the data.

Fig 1


Primawera can be run in multiple ways, depending on your use case. It is possible to supply the application with NumPy data or a path to an image.

Primawera can be run directly from the command line using the command:

$ primawera

Invoking this command creates an empty window allowing the user to select which image file to view using the operating system's dialogue. This way, a single TIFF file containing 3D (RGB or grayscale), floating point, or complex data can be viewed. Also, the user can select a single directory from which the application will open all PNG files and join them into a single image stack.

To visualize a NumPy array, Primawera has to be invoked inside a Python script as is described in detail on the GitLab website.

Note on design

The application was designed and developed for the digital image processing course at Masaryk University; therefore, the application promises to minimize the behind-the-scenes operations of other visualization options, such as Pyplot. Hence, the user might need to apply basic filters such as gamma correction or linear contrast stretching using the filter menu inside the application.

Download & Licensing

Primawera is a native cross-platform desktop application developed in Python using the Qt5 library. It is licensed under GPLv3, and the complete source, along with exemplary code and reference, can be obtained on GitLab. The newest stable version is automatically published to PyPI.