gralp-1 / binviz

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Binviz

What is it?

Binviz is a binary visualization tool. It takes a file and produces an image or point cloud that visualizes the binary data.

How does it work?

2D image

Each consecutive pair of bytes is a coordinate to a 256x256 image. The image counts the occurance of each pair of bytes which is used to represent the brightness of the pixel at that coordinate. Before the image is created, the data is normalized to the range 0-255 with an additional transformation function to amplify lower values.

3D point cloud

Each consecutive triplet of bytes is a coordinate to a 256x256x256 point cloud. The point cloud counts the occurance of each triplet of bytes which is used to represent the brightness of the pixel at that coordinate.

How do I use it?

go build .
./binviz -file <input file> -output <output name> -dimension <dimension> -brightness <brightness> # output name, brightness and dimension are optional

Examples

Input:
zezin
Output 2D:
image
Output 3D:
image

File format

I can't find any file formats that support 4 dimensions, so time to make my own.
The file format is very simple, it's just a header followed by a list of points. It takes inspiration from the .ppm and .pcd formats.

Example

VERSION <semver string>
DIMENSION <2 | 3 | 4>
x y val       // 2D
x y z val     // 3D
x y z w val   // 4D

All fields must be from 0-255.

TODO

  • Refactor to make consistent
  • Add proper command line flags & arguments
  • Adjustable brightness curves
  • Make vizualiser

About

License:MIT License


Languages

Language:Go 100.0%