Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Binary Visualizer

Simple C program to visualize binary files as 2D images. Two pair of bytes are read from the file and adds to the brightness of the pixel with thoose coordinates. The resulting image is saved as a png. Can also read images using stb_image and then iterates over the uncompressed pixel data to visualize it.

Brightness is calculated as the logorithm of the number of times a pair of bytes occurs, normailized to the range of 0-255.

Compilation

Written in C23, tested on Windows 11 with gcc.

gcc main.c ./lib/fcu_windows.c -std=c23 

Usage

./a input_file

Result is saved to result.png in the same directory, if the file is an recognized image format, the result of the uncompressed pixel data is also saved to raw image visualization.png.

Examples

Text file

main.c visualized

result for main.c

lib/stb_image.h visualized

result for stb_image.h

Executable file

a.exe visualized

result for a.exe

x64 vs arm

The openttd.exe executable from the x64 version and arm64 version (Windows, OpenTTD version 15.2).

x64 version:

result for openttd.exe x64

arm64 version:

result for openttd.exe arm64

Photograph

Original image:

original image

Binary visualization:

result for Rasmus äter soppa.png

Pixel data visualization:

raw image visualization for Rasmus äter soppa.png

Image

Original image:

original image

Binary visualization:

result for Pathfinder Kingmaker Original Game Soundtrack.jpg

Pixel data visualization:

raw image visualization for Pathfinder Kingmaker Original Game Soundtrack.jpg

Avif vs Jpg

Image:

original image

Pixel data visualization:

raw image visualization for chris-greenhow-3FjIywswHSk-unsplash.avif

Jpg binary visualization:

result for chris-greenhow-3FjIywswHSk-unsplash.jpg

Avif binary visualization:

result for chris-greenhow-3FjIywswHSk-unsplash.avif

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages