Skip to content
This repository has been archived by the owner on Mar 7, 2023. It is now read-only.

Latest commit

 

History

History
36 lines (24 loc) · 1.53 KB

README.md

File metadata and controls

36 lines (24 loc) · 1.53 KB

voxel-cat Optimize

Overview

voxel-cat is an entry for the JS1k 2019 "X" JavaScript code golfing competition.

The goal of the competition is to create a fancy JavaScript demo up to 1024 bytes.

voxel-cat

Demo Description

This entry is a demonstration of CT scan, also known as computed tomography scan, and formerly known as CAT scan, which makes use of computer-processed combinations of many X-ray measurements taken from different angles to produce cross-sectional images of a scanned object, allowing the user to see inside the object without cutting.

Data

Demo data is based on Wioletta Orłowska's voxel cat image with small modifications.

Voxel data has been created with Goxel voxel editor.

Optimizations

Voxel data has been compressed with a fixed-length pattern substitution compression algorithm implemented in Ruby with a small decompressor in JavaScript.

Among various code golfing tricks, for further optimizations the JavaScript code has been minified with Closure Compiler with minor manual tweaks baked into a Gradle script.