Pages: [1]   Go Down

Author Topic: photo data information  (Read 2122 times)

DeanSonneborn

  • Newbie
  • *
  • Offline Offline
  • Posts: 44
photo data information
« on: March 13, 2010, 12:02:24 pm »

I just realized that a digital photo is not really a miniature photo inside the photo file but it is really just a bunch of numbers that describe the photo. I wonder if there is a way to open a photo file and see the actual data that gets translated into the photo?
Logged

milt

  • Jr. Member
  • **
  • Offline Offline
  • Posts: 70
    • Striking & Distinctive Custom Photographic Prints
photo data information
« Reply #1 on: March 13, 2010, 01:25:14 pm »

EVERY computer file, photo or otherwise, is in reality just a long string of 1's and 0's (also called "bits").  Its the interpretation of those bits by a program that understands the conventions that were used when the file was constructed that results in human-usable interpretations of computer files, like say putting an image up on your computer monitor, or putting some text of a document up on your monitor.

There are LOTS of programs that will let you view the bits (or usually the bytes, i.e. clusters of 8 bits) of a file, depending you what operating system you use.  Why you might want to do this a relevant question here.  Why do you want to look at a long sequence of numbers?

--Milt--
« Last Edit: March 13, 2010, 01:26:57 pm by milt »
Logged
Los Gatos, California | http://miltonbarber.com

DeanSonneborn

  • Newbie
  • *
  • Offline Offline
  • Posts: 44
photo data information
« Reply #2 on: March 13, 2010, 06:13:31 pm »

I am trying to understand how a computer programs translates the photo file into a photo image on the screen.
Logged

Gary Brown

  • Full Member
  • ***
  • Offline Offline
  • Posts: 211
photo data information
« Reply #3 on: March 13, 2010, 07:23:50 pm »

Quote from: DeanSonneborn
I am trying to understand how a computer programs translates the photo file into a photo image on the screen.
You can read about JPEG in this WikiPedia article, but it's quite complex, and there's not really any way to look at the bits and figure out, by hand, what it would end up looking like as an image.
Logged

milt

  • Jr. Member
  • **
  • Offline Offline
  • Posts: 70
    • Striking & Distinctive Custom Photographic Prints
photo data information
« Reply #4 on: March 13, 2010, 09:49:07 pm »

Quote from: DeanSonneborn
I am trying to understand how a computer programs translates the photo file into a photo image on the screen.

OK, I can give you just a glimmer of a start.  Take a .jpg file, and ignore completely issues of file compression and color management and things like raster pattern.  First, the program doing the reading (say Photoshop) has programmed into it a knowledge of the format of .jpg files.  It knows where in the long string of bits it can find a specification of the size of the image.  So it goes there and picks up the number of horizonal and vertical pixels of the image in the file.  It also knows where in the long string of bits it can find the start of the pixels of the image, so it goes there and picks up 3 bytes, one byte each for the red, green, and blue values that together define the color of the first pixel of the image.  It then moves those bytes to a special location in video memory.  This location is defined by where on the screen PS wishes to show the image.  (The monitor is constantly refreshed from this memory by the video card, which runs separately from the computer itself.)  PS then repeats this action for all of the pixels in the image, using the image size it picked up earlier to tell how long each row is and how many rows there are. Voila -- an image on the screen.

Now, I have skipped over a huge number of things that make this process not really that simple in real life, but that's the basic idea.

--Milt--
Logged
Los Gatos, California | http://miltonbarber.com

ThePhotoDude

  • Full Member
  • ***
  • Offline Offline
  • Posts: 161
    • Fine Art, Landscape and Travel Photographer
photo data information
« Reply #5 on: March 15, 2010, 11:00:05 am »

If looking at the data structure of a JPG file, this may be more complicated because of the compression algorithms etc.
Rename your JPG with a TXT extension and open the photo with notepad - The output is garbage and meaningless (to me, not the computer) and very random.

The notepad is not the correct was to view the binary data but bear with me ..

Now do the same with a bitmap image (.BMP) and open in notepad - still undecipherable, but you can see the data has some structure and pattern.

Basically, the BMP reads pixel 1 is 'color A' pixel 2 is 'color B' and so on.
With JPG compression, it reads like pixel 1 through to 120 is color A, so I will just save that data, pixels 121 to 145 is Color B etc etc.

So I'm not saying look at the binary in notepad cos that won't work, but maybe you get a better understanding of the structure starting with a bitmap file not a jpg.

Good luck!
Logged

bill t.

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 3011
    • http://www.unit16.net
photo data information
« Reply #6 on: March 15, 2010, 11:38:52 pm »

I have had my nose in digital electronic technology almost daily since 1974.  I have built circuits, designed chips, programmed all kinds of software.  After thinking about your question for about half an hour, I realize I can not give a satisfactory answer.

But just arrange large numbers of binary logic states in clever enough ways, and use the information so represented to variously color photogenic substances on screens and to decide what color ink to apply to tow and column arrangements of dots on media surfaces.  A bunch of logic states stacked up one way represents pink, stack them another way for green.  It is convenient to store and modify the cleverly arranged binary logic states as magnetic or electric fields, such as on hard discs and flash cards and computer memory circuits.  But in the end it's all about arranging lots and lots of binary states in lots of little sub-arrangements that encode meaning.

John Campbell sometimes whimsically used the allegory that computer chips were like angels and other spiritual beings, that's a good answer too it is how most people including engineers actually think about it.
Logged

Justan

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 1928
    • Justan-Elk.com
photo data information
« Reply #7 on: March 16, 2010, 04:11:29 pm »

> I just realized that a digital photo is not really a miniature photo inside the photo file but it is really just a bunch of numbers that describe the photo. I wonder if there is a way to open a photo file and see the actual data that gets translated into the photo?

You could open a .jpg or any file with a number of different viewer/editor programs. Google will lead you to several examples – look for hex or binary format viewer/editors. Note that when using any of these file viewer/editors DO NOT save the file you are viewing/editing as doing so may damage the file.

> I am trying to understand how a computer programs translates the photo file into a photo image on the screen.

You can find detailed answers by reading about at how image file formats are designed. If you wanted to learn about this in a practical way, the next step would be to find a book or two on a programming language and spend some time to learn little about computer programming. It is a very worth while study.


Pages: [1]   Go Up