ImaproFX – Image Processing Framework

ImaproFX – JavaFX Image Processing Framework

Grasping the essence of image processing and analysis algorithms may prove to be quite difficult. To simplify the comprehension of such algorithms, sugarcubeIT proposes ImaproFX, a Java FX user interface providing live visual feedback thanks to interactive controllers.

The real power of ImaproFX comes from it’s Java coding framework… Coders can create their own image analysis ribbons simply by extending and implementing an abstract “ImaproFilterFx” class :

Post written by Jean-Luc Bloechle

Deep Neural Network – Learning to draw

An interesting feature of Deep Neural Networks is their ability to tend to a simplified image using few neurons and many layers… Watch this CNN training evolution giving birth to AI artistic painting !

Using sugarcube’s Deep Learning API :

Post written by Jean-Luc Bloechle

Algolive – Sorting algorithms visualisation

Understanding sorting algorithms may be a bit tricky : InsertionSort, SelectionSort, BubbleSort, ShellSort, QuickSort, MergeSort.

In order to simplify the comprehension of such algorithms, sugarcubeIT propose Algolive, a simple animated user interface implemented in HTML5 (CSS3 & JavaScript) able to visually decipher the key steps of several major sorting algorithms.

AlgoLive is freely accessible for any personnal and teaching use :

Post written by Jean-Luc Bloechle

Vote Results Table Detection

The automatic extraction of vote results from tables is no more a burden thanks to SugarcubeIT table detection tools. Using Insight, our OCD end user interface, we dynamically restructured thousands of tabular data into Excel spreadsheets.

Legal Ad Detection

Using OCD as a pivot format SugarcubeIT implemented a dedicated tool able to detect legal advertisement from PDF documents.
Below image shows ruler detection with green dashed lines while advertisement detection is highlighted thanks to straight oblique colored lines.

From Hard Paper to OCD

Sugarcube handles data coming from scanned documents through its OCD (Open Canvas Document) file format. Here is our receipt how to batch convert scanned document to our proprietary OCD standard.


  • Batch convert tif images to vector content (OCD files)
  • OCD is a file format which keeps the vector graphics capacity of PDF files while greatly simplifying its internal representation (using XML).
  • OCD is a powerful format we use as a base for further high-level processing and/or format conversion :
    • PDF – either pure vector graphics, or image-based with a transparent text layer
    • ePub – the standard format for ebook publishing, ePub3 can represent both fixed layout content and reflowing content (liquid layout).
    • XML – the defacto standard for text based data exchange


  • 283’917 tif images , scanned pages from “Recueil des lois fédérales” from 1947 to 1998 (German and French)
  • a total amount of 3,24 TB
  • image resolution : 300 dpi in 24-bits rgb
  • below, a preprocessed bitmap (with paper background removal) image followed by its output OCD counterpart



  • Fedlex OCD generation is completely automated in order to batch process the whole tif repository  (each document is archived in a folder, i.e., a repository sub-folder).
  • The tool first copy & paste tif images from a single document to a OmniPage DocuDirect hotfolder.
  • OmniPage dynamically processes each tif image and generates an OCR output file per image (see below sample).
  • Fedlex detects OmniPage end of job and converts OCR files to OCD (see below sample).
  • The system iterates until all tif folders have been processed.

Scan Background Removal

Removing the paper background from scanned document is not a trivial task. Here is how sugarcube addresses the problem.


  • Remove paper background from scanned documents in order to create searchable PDF files composed of binary images together with transparent text layers
  • Binary images assume black text over white background in order to get :
    • a good reading experience
    • a compact file size
  • Develop an automatic process to apply on a batch of tif files


  • 420’000 TIF images, scanned pages from “Recueil des lois fédérales” from 1947 to 1998 (german, french and italian versions)
  • a total amound of 6,8 TB (TeraBytes)
  • image resolution : 300 DPI, 24-bits RGB


Here above are some representative input samples of the corpus with their respective output counterparts :


  1. First, we get a TIFF image from the scanned Swiss “Bundesarchiv”.bg_original
  2. Our algorithm then computes the mean background colors for small image tiles.bg_tile
  3. The resulting blocky effect is filtered using a bilinear interpolation.bg_interpol
  4. The algorithm subtracts the background image from the original one, resulting in a non homogeneous light background.bg_subtract
  5. A final dynamic gamma correction is applied to get rid of remaining


Getting rid of scanned document paper background is not a straightforward process. Our experience shows that scanned documents variability forces the implementation of an adaptive algorithm.

For instance, tuning a binary threshold from grey level images is clearly not a viable solution with such a heterogenous corpus containing images subject to luminosity, contrast and hue defects.