Giter Site home page Giter Site logo

disk2png's Introduction

disk2png

Create a PNG image from a disk image (or basically any file).

Usage

disk2png inFile outFile.png [blockSize level]

inFile : file name of the disk image

outFile.png : file name of the output PNG image

blockSize : optional size of one block (column in the PNG image), default = 1024

level : optional output level see Output level section, default = b (small)

The command line parsing is quite naive for now, if you want to set the level you have to include a blockSize.

Output level

The disk2png program can generate output PNG files with different levels. Small b and large B

b output

Every pixel in the resulting image corresponds to one byte in the source file. The pixel colour represents the value of the byte:

  • blue pixels for bytes 0x01 to 0x19
  • green pixels for classic readable text 0x20 to 0x7f
  • red pixels are bytes 0x80 and above

Example for exfat.img:

Example of the small b, every pixel represents a byte in the source image.

B output

Every pixel represents eight bytes from the source disk image. The brightness value represents the number of non-zero bytes (so black for 8 zero bytes, almost white for 8 non-zero bytes)

Example for exfat.img:

Example of the large B, every pixel represents eight bytes from the source image.

Warning

This is a direct rewrite from a really ancient PHP script I wrote decades ago, so it is quire suboptimal and probably unsafe :-) It may crash, do something, you don't want, use with caution.

ToDo (someday maybe)

  • "sanitize" and code clean up
  • check with valgrind
  • ability to create more "rows" (probably makes sense only for B output)
  • borders and padding
  • in-image label
  • maybe multi-threading

disk2png's People

Contributors

robertvalik avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.