SkillAgentSearch skills...

Stereogramaxo

Self-designed Autostereogram Generator

Install / Use

/learn @mexomagno/Stereogramaxo
About this skill

Quality Score

0/100

Category

Design

Supported Platforms

Universal

README

Stereogramaxo

This started as a weekend project, inspired on boredom and genuine love and curiosity for these beautiful works of art.

It is written in python for the sake of simplicity, and relays on the active PIL fork, Pillow for image processing.

Examples:

The following images were generated by using this tool. In order to understand them, you should know how to see stereograms.

sharks

Usage:

The project is built as a python script.

$ python main.py --help
usage: main.py [-h] (--depthmap DEPTHMAP | --text TEXT)
                (--dots | --pattern PATTERN) (--wall | --cross)
                [--dot-prob DOT_PROB] [--dot-bg-color DOT_BG_COLOR]
                [--dot-colors DOT_COLORS] [--blur BLUR]
                [--forcedepth FORCEDEPTH] [--output OUTPUT]

Stereogramaxo: An autostereogram generator, by Mexomagno

optional arguments:
  -h, --help            show this help message and exit
  --depthmap DEPTHMAP, -d DEPTHMAP
                        Path to a depthmap image file
  --text TEXT, -t TEXT  Generate a depthmap with text
  --dots                Generate a dot pattern for the background
  --pattern PATTERN, -p PATTERN
                        Path to an image file to use as background pattern
  --wall, -w            Wall eyed mode
  --cross, -c           Cross eyed mode
  --blur BLUR, -b BLUR  Gaussian blur ammount
  --forcedepth FORCEDEPTH
                        Force max depth to use
  --output OUTPUT, -o OUTPUT
                        Directory where to store the results

  --dot-prob DOT_PROB   Dot apparition probability
  --dot-bg-color DOT_BG_COLOR
                        Background color
  --dot-colors DOT_COLORS
                        Colors of dots

The demo images above were generated by issuing:

# First shark: Dot pattern
$ python main.py --depthmap depthmaps/shark.png --dots --wall --output .
{"text": "output_image_1.png", "code": 200}
# Second shark: Image pattern, cross-eyed
$ python main.py --depthmap depthmaps/shark.png --pattern patterns/jellybeans.png --cross --output .
{"text": "output_image_2.png", "code": 200}
# Third shark: Flatter, smoother:
$ python main.py --depthmap depthmaps/shark.png --pattern patterns/jellybeans4.png --wall --forcedepth 0.4 --blur 10 --output .
{"text": "output_image_3.png", "code": 200}

On success, the resulting image will be stored inside the specified output folder. If no output directory is specified, the generated image is temporarily displayed.

Web GUI

As a convenience feature, I include a simple web gui to interact with the script, as well as a PHP backend script to interface between the python script and the GUI.

First screen web gui

From the GUI you have access to every feature of the cli script. When generated, the resulting image is displayed in a modal over the form.

Editing to create a dot-pattern 3D text stereogram web gui

Installation

CLI tool:

  1. Clone the project somewhere
  2. Install the required pip packages specified in the Pipfile

Web GUI:

  1. Install a web server (I used Nginx)
  2. Install php (5 or higher should be enough)
  3. Move files from WEB folder to wherever you need to in order to make them accessible from your web instance
  4. Make sure to correctly configure file permissions to be able to use them with your webserver
  5. Edit the WEB/run.php file and change the value of the $sirds_path variable to point to where you cloned the project
  6. Done

Beware of the paths I'm using inside this file: I use an ENV folder, as this is where I configured my virtualenv. Change it to match your own environment.

Features

  • Support for Random dot and image-based patterns
  • Customizable dot pattern colors (background, dots)
  • Text depth map generation (as an alternative to external depthmaps)
  • Wall-eyed and Cross-eyed modes supported
  • Center-to-sides pixel displacement
  • Blur filter
  • Process done on oversampled copy for smoother results
  • "Forced depth" feature, allows to force total depth independent of the actual depthmap grayscale range. Useful if depthmap levels are extreme or too flat.

TODO:

  • Maybe some optimizations (multi threading?)
  • Host somewhere
  • Improve artifacts on sharp edges (specially on autogenerated text depth maps)

What never got to be done

(take a look at animated_sirds.py)

  • Animated stereograms by varying depth, smoothness, background patterns
  • Animated stereograms using depthmap based videos
View on GitHub
GitHub Stars22
CategoryDesign
Updated4mo ago
Forks8

Languages

Python

Security Score

87/100

Audited on Nov 18, 2025

No findings