Skip to content

Latest commit

 

History

History
35 lines (31 loc) · 1.1 KB

FORMAT.md

File metadata and controls

35 lines (31 loc) · 1.1 KB

Image format conversion

To convert the .ppm files to more common image formats, do the following:

Setup

In this directory:

  1. Install Docker
  2. Build the converter image:
docker build . -t ray-tracer-format -f format.Dockerfile
  1. Create a converter container and run it interactively:
docker run -v "$(pwd)"/../:/source/ray-tracer \
    --name ray-tracer-format-container \
    -it ray-tracer-format
  1. Restart and attach to the converter container at a later point:
docker start -ai ray-tracer-format-container

GIF conversion

  1. In the running docker container, generate a .gif from all files in build/artifacts/<example-name>/ppm/animation:
./format/format.sh <example-name>
  1. Find the animation in build/artifacts/<example-name>/gif/<example-name>.gif

PNG conversion

  1. In the running docker container, generate a .png from a single file in build/artifacts/<example-name>/ppm/:
./format/format.sh <example-name> -t highres
  1. Find the high resolution image in build/artifacts/<example-name>/png/<example-name>.png