Bit viewer/editor for peeking at PNG format

  • Thread starter Thread starter DaveC426913
  • Start date Start date
  • Tags Tags
    Bit Format
Click For Summary

Discussion Overview

The discussion revolves around the need for a tool to parse and examine PNG format files, focusing on understanding the byte structure and visual representation of the data. Participants explore various programming approaches and tools for handling PNG files, including the challenges of decoding and displaying the pixel information.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant seeks a freeware viewer tool to examine the bits of PNG files, expressing a desire for practical guidance on interpreting the format.
  • Another suggests using the libpng library for low-level access to PNG files, noting that it is written in C and provides a manual for reference.
  • A participant indicates a preference for using Visual Basic over C, citing a lack of familiarity with C programming.
  • Concerns are raised about the limitations of Visual Basic for low-level file reading, particularly regarding memory addressing and performance issues with compressed file formats.
  • One participant expresses confusion about the representation of pixel data, initially believing it to be straightforward ASCII values, but later acknowledges the complexity involved in decoding PNG files.
  • Another participant clarifies that PNG files undergo compression and transformations, which complicates direct reading of pixel information from the file.
  • A suggestion is made to use existing Windows editors like UltraEdit or TextPad for viewing binary files, though it is noted that this would not assist in decompressing the PNG data.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the best approach to parsing PNG files, with differing opinions on the suitability of programming languages and tools for the task. The discussion reflects multiple competing views on how to effectively handle PNG data.

Contextual Notes

Participants highlight limitations related to programming language capabilities, particularly regarding memory management and processing speed for decoding compressed image formats. There is also an acknowledgment of the complexity involved in interpreting PNG file structures.

DaveC426913
Gold Member
2025 Award
Messages
24,551
Reaction score
8,866
I want to parse PNG format files, and I need to understand what they're doing with the bytes. Dropping a PNG into Notebook shows ASCII versions of the bytes. I need a small freeware viewer tool to examine the bits themselves.

Can someone point me at something I could use?

Also, while I am reading up on PNG format, I could use some direction on practical (or prefereably even visual idiot's guide) interpretation of the format (as opposed to theory).

D.
 
Computer science news on Phys.org
I don't know enough C to do much with it. I'll probably write it in a lang more familiar, like Visual Basic.
 
Low level reading of a png files requires addressing memory using pointers. You can't do that with VB.

Here is what I found on google groups:

"...no VB code seems to be available to fully decode
PNG (or GIF, or JPG for that matter) to screen. Sure, there's C
source available, but nobody seems to want to port it to VB.
The prime reason is probably that these file formats are *heavily*
compressed, and the number-crunching involved in decoding this stuff
(requiring, by the way, floating point calculations) would simply be
too slow in VB."
 
Last edited:
Really? I thought it formatted the pixels in bytes. i.e. each pixel would show as an ASCII value. I guess I was oversimplifying.

Drat. One more stumbling block in the way of my master plan.
 
You have to understand that you compressing the file and doing some other tranformations to the data. Therefore you can't just start reading at the beginning of the file and expecting to see pixel information. You first must decompress and transform the file into ram and then you can read the pixels chunks from memory. VB just doesn't have the speed or capbabilities to do this.
 
Sure you can look at the binary data, but that won't do you any good unless you can decompress the file.
 

Similar threads

  • · Replies 6 ·
Replies
6
Views
4K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 16 ·
Replies
16
Views
6K
  • · Replies 23 ·
Replies
23
Views
4K
  • · Replies 3 ·
Replies
3
Views
13K
  • · Replies 6 ·
Replies
6
Views
4K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 4 ·
Replies
4
Views
16K
  • · Replies 129 ·
5
Replies
129
Views
26K