Skip to main content

Figure Generator

Project description

Figure Generator

This is an awesome figure generator. It generates figures in pdf-, html- and pptx-format. The following image shows the output of one of our test files ("tests/pool.py"):

This tool might help not only to create final figures, but also to analyze images faster: We offer a bunch of error metrics that allows not only to compare images visually but also mathematically.

Why did we create a figure generator?

In rendering research, it is quite common to create figures of "comparison"-type. Meaning, that we start with a set of generated images, that needs to be compared. Often, one rendered scene is not enough, therefore, we need several comparison figures - preferably in a similar or same style as the other created figures.

We support grids (images that are grid-like arranged) and simple line-plotting. To get a further understanding what grids are, you might want to have a look at our tutorial (Tutorial.ipynb).

Dependencies

Mandatory:

  • Python 3.11+ with opencv-python, simpleimageio, and texsnip

Optional:

  • For the .pdf backend: pdflatex (in path) with at least: tikz, calc, standalone, fontenc, libertine, inputenc.
  • For the .pptx backend: python-pptx
  • To include pdf files as image data: PyPDF2, and pdf2image (which requires poppler).

Quickstart

You can install the figure generator and all mandatory dependencies with a simple:

python -m pip install figuregen

The fastest way to get a first figure is by using an existing template:

import simpleimageio as sio
import figuregen
from figuregen.util.templates import CropComparison
from figuregen.util.image import Cropbox

figure = CropComparison(
    reference_image=sio.read("images/pool/pool.exr"),
    method_images=[
        sio.read("images/pool/pool-60s-path.exr"),
        sio.read("images/pool/pool-60s-upsmcmc.exr"),
        sio.read("images/pool/pool-60s-radiance.exr"),
        sio.read("images/pool/pool-60s-full.exr"),
    ],
    crops=[
        Cropbox(top=100, left=200, height=96, width=128, scale=5),
        Cropbox(top=100, left=450, height=96, width=128, scale=5),
    ],
    scene_name="Pool",
    method_names=["Reference", "Path Tracer", "UPS+MCMC", "Radiance-based", "Ours"]
)

# here you can modify the figure layout and data
# ...

# Generate the figure with the pdflatex backend and default settings
figuregen.figure([figure.figure_row], width_cm=17.7, filename="pool_with_template.pdf")

The template simply creates a list of Grid objects that can be modified and extended arbitrarily before passing it to the figure() function.

Examples and inspiration for creating your own figure layouts can be found in our examples or the Jupyter tutorial.

Examples

Clicking on an image below leads to the test that created the corresponding figure.

Vertical stacks

Split Comparison

Crop Comparison

Plots

Grid with titles, labels, markers, and frames

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

figuregen-1.3.1.tar.gz (67.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

figuregen-1.3.1-py3-none-any.whl (71.4 kB view details)

Uploaded Python 3

File details

Details for the file figuregen-1.3.1.tar.gz.

File metadata

  • Download URL: figuregen-1.3.1.tar.gz
  • Upload date:
  • Size: 67.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for figuregen-1.3.1.tar.gz
Algorithm Hash digest
SHA256 6a3f271461fe4369ea830912e634686a93a177bb1a0da2898800122e69c5c449
MD5 f5500d47772f4b77f168c910acf1321d
BLAKE2b-256 485d12fba8d9d712dde776d45ce0add20be3487ef9b4750f9a7330c0df411529

See more details on using hashes here.

Provenance

The following attestation bundles were made for figuregen-1.3.1.tar.gz:

Publisher: publish.yml on Mira-13/figure-gen

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file figuregen-1.3.1-py3-none-any.whl.

File metadata

  • Download URL: figuregen-1.3.1-py3-none-any.whl
  • Upload date:
  • Size: 71.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for figuregen-1.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 05072371a0f6e8282eb4ebc202858c85df1ea1485f0f3f28f84795b2ce49ff06
MD5 9dde8145b2fe7fb0e03cd16c71477436
BLAKE2b-256 aae7ad415f0eb762a5285efb5f885c4cbe26964871fbe230bac23f2e840900e3

See more details on using hashes here.

Provenance

The following attestation bundles were made for figuregen-1.3.1-py3-none-any.whl:

Publisher: publish.yml on Mira-13/figure-gen

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page