Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 526
  • Last Modified:

bmps and jpegs

could any one kindly explain how bmp's and jpegs are stored or more imprtantly how can they be decoded. how does the software know about the size of the image (a x b) pixels.
and what is the colour combination. kindly give me details because i am a novice in this area.
thank you.
 
0
darpangoel
Asked:
darpangoel
1 Solution
 
KenAdneyCommented:
although it's more about gifs & jpgs, http://www.askscott.com/scott/scholastic/GIFJPG.htm may have the info you need.
0
 
thundercageCommented:
Try this site for more information

http://www.dcs.ed.ac.uk/home/mxr/gfx/
0
 
Lightning974Commented:
Although your question doesn't lend any exact answers, maybe the following will help you.

A .bmp (Bitmap) is an exact replica of what you see, pixel by pixel, color stays intact. Making the file size much larger than that of a .jpg.

A .jpg is a compressed version of the an original image. Varying in most cases from 0 (complete loss) to 100 (least compressed and closest to exact).

To describe how a .jpg compresses the colors (depending on how much compession you select (0-100) is hard to do but here goes: Each pixel looks at its neighboring pixels and says "how closely do you resemble me, and depending on the compression, it may change both colors a bit closer in color range. It does this at every pixel, that is why when you save a jpg with higher compression it starts to blur, because each pixel is adjusting it's color a bit.

Think of it as every pixel anti-aliasing to every other neighboring pixel.

That is the basic differences, the size info along with bit depth etc. is all stored in the header of the file.

Hope this helps.
0
 
darpangoelAuthor Commented:
well i want to actually write a code in c++ to display a .bmp and a .jpeg file. so for that i wanted to know how the files headers are written and how these files are encoded.
0
 
hemanthsharmaCommented:
BITMAPS GERENALLY, AS THE NAME ITSELF SIGNIFIES ARE CONSTRUCTED ON BASIS OF BITS..

EACH DOTS YOU SEE ON YOUR SCREEN ARE CALLED BITS... (GENERALLY CALLED PIXELS)

SO, EACH BITMAP WILL HAVE CERTAIN PIXELS ON THE IMAGE OF DIFFERENT COLOR EACH.

PIXELS ARE TAKEN INTO CONSIDERATION BY DEFINING THE DIMENSION OF THE IMAGE.

E.G., 100 Px X 200 Px

THIS DENOTES THAT THERE ARE 100 PIXELS HORIZONTALLY ON 1 X AXIS AND 200 PIXELS VERTICALLY ON Y AXIS.

SIMILARLY, JPEGS ARE COMPRESSED BITMAPS BUT NOT AS CLEAR AS BMPS...

THERE ARE ONLY SOME COLORS DEFINED IN JPEGS INSTEAD OF SUPPORTING ALL POSSIBLE COLORS TO AVOID THE INCREASE IN FILE SIZE.

JPEG file is always compressed and so the file sizes of all jpegs are less.. this affects colors.. try converting a big bmp file to a low quality jpg, you will see unwanted and un expected color pixels......

THE COLORS IN JPEG MAY BE NEARER TO THE COLORS IN BMP FILE. BUT NOT THE EXACT ONES...
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now