Parag
Parag

Reputation: 680

Reading jpeg image using c/c++

How to read the pixel values of jpeg image using c/c++, without using any library. I read about how compression takes place in jpeg in my course,i want header information.

Upvotes: 1

Views: 5538

Answers (1)

Veger
Veger

Reputation: 37905

For the syntax of the file you can check wikipedia.

Each segment has its own marker. The variable length segments have a two byte field for their length. So far is not really a problem, as you are able to extract all segments using this information (or at least it seems so on a first glance).

The more problematic part is to actually do something useful with the data inside the segments. The wikipedia page provides information on this topic, but it will require quite some mathematic knowledge to actually decode and grab the pixels.

Upvotes: 1

Related Questions