UP | HOME

# Anaglyph HALD Generator (Anahald) - Future Development Directions

By Oleg Kosyakovsky

## Table of Contents

- Image classification and result estimation
  - Sides-ratio histogram
- New commands to make conversions of one image with several HALD-s
- Minimalistic GUI
- Methodology to build input configurations
- Two-stage workflow methodology and supporting code
- Test-chart images
  - Red-cyan extinction (cross-talk) estimation
  - Cross-talk vs parallax
  - Turn HALD into an inclined stereopair

This page lists arbitrary ideas for Anahald extensions and improvements. The author doesn't commit on any particular item. Decision to implement anything from here will be taken based on presence of at least one of the below factors:

- author's own needs
- constructive(:)) interest of other parties

Notes on glossary:

- the author uses interchangeably the terms "folder" and "directory"; the former is misleading but widely known , the latter is technically correct but for some reason "obstructed" from the common users
- the author uses interchangeably the terms "Tcl shell" and "Tcl interpreter"
- the author uses interchangeably the terms "command-shell* and "shell*; these refer to CMD or BASH
- "LUT" means lookup table, "CLUT" means color lookup table; the author uses these two terms and terms "HALD", "HALD-LUT", "HALD-CLUT" interchangeably
- "Identity-HALD" standardly means a HALD-CLUT that maps each color to itself
- the author refers to a HALD-CLUT made by Anaglyph HALD Generator as "balanced HALD"
- the author uses interchangeably the terms "configuration file", "config file", and "config"
- the author uses interchangeably the terms "anaglyph" and "red-cyan anaglyph"
- "balancing" a color means replacing it with some related anaglyph-friendly color obtained by reducing the difference between red channel on one side, and green and blue channels on the other side
- sides-ratio is a ratio between values of red channel, and maximum of green and blue channels - the larger divided by the smaller; used as a measure of disbalance in colors

## Image classification and result estimation

### Sides-ratio histogram

Such a feature would serve both for classification and for result estimation.
Implementation suggestions:

- Fixed number of bins - 5? - to begin with.
- Implementation could be based on ImageMagick color histograms:
  Go to https://legacy.imagemagick.org/Usage/quantize/#map then search for "The Colors in an Image".

## New commands to make conversions of one image with several HALD-s

Use LIST or GLOB keywords to specify the HALD-s - as in 'anahald_cfg_table.bat'

## Minimalistic GUI

While the author himself doesn't find it anyhow useful, request from important customers (if any) will prompt making some arrangement for GUI-only users.
These will provide the functionality with no concern given to the cosmetics.
Possible implementations of Anahald commands - users' view:

1. anahald_lut_make.sh -help
   Not needed
2. anahald_lut_make.sh <CONFIG-PATH> <HALD-LEVEL> <OUTPUT-DIRECTORY-PATH>
   - two shortcuts for HALD-levels 8 and 16
   - interaction upon clicking a shortcut:
     a) opens a new window with standard Tcl file-choice dialog to select the config-file path
     b) after the config-file-choice dialog is closed, opens a new window with standard Tcl directory-choice dialog to select the output-directory path
   - how each dialog reacts:
     - pressing "Ok" confirms the choice, closes the dialog and continues
     - pressing "Cancel" cancels the command, closes the dialog, and terminates
     - invalid choice brings error message in a separate modal message-box, then the dialog refreshes or restarts
   - while the command runs, a non-modal window with "This window will close when 'anahald_lut_make' command terminates. You can work with other applications while this runs"

## Methodology to build input configurations

So far the single useful advice is to start from the configurations of included pre-made HALD LUT-s and tweak to achieve the desired effect.
Generally, the methodology-definition task is the area with the greatest collaboration potential.

## Two-stage workflow methodology and supporting code

Usual workflow suggests applying balancing HALD at the end - to guarantee no further color modifications.
But having the same (or related) HALD applied in an earlier stage as well would help to better visualize the effects of color modifications during stereo-picture editing process.
In addition, some RAW-converters - for example RawTheraphy - allow to apply a HALD LUT as a part of their processing pipeline.
As it looks to the author so far, the ultimate HALD must be (re)applied somewhere after the last stage that may alter image colors, no matter what.

## Test-chart images

### Red-cyan extinction (cross-talk) estimation

For the first edition, David Romeuf's "potentiometer" image from https://www.david-romeuf.fr/3D/Anaglyphes/BonCoupleEL/GoodCoupleMonitorGlassesAnaglyph.html is used - by his permission.
So far the author has no better ideas.

### Cross-talk vs parallax

These prove that reducing depth-budget allows weaker red/cyan filters.
Generated charts based on displaced-text image-pairs appear in *Filter strength.

### Turn HALD into an inclined stereopair

"Inclined" means tilted backward or forward.)
For HALD-s in ImageMagick text format - function working on HALD text file to alter coordinates per line - adds two terms to X coordinate:

1. major term depends on Y coordinate and defines parallax to achieve the requested tilt
2. minor term is constant per each HALD that differentiates the left-eye image from the right-eye HALD image.

This function runs twice - to make left- and right-eye HALD-images.
For HALD-s in any other format - convert into ImageMagick text format and use the function for it.

Oleg Kosyakovsky

Haifa, Israel

2024-2025