Posted on 2002-04-09
Medium Priority
Last Modified: 2012-08-13
I am a trainee and I have been assigned a project
which is about image comparison.  it involves reading of gif or jpeg or tiff files.  
As GD is a software which is used for such purposes. We want to develop like this but with many additions
acc to our project.

Can anyone suggest some tutorials for writing C programs for such purposes?

Basically I need to read the image file.

Thanks in advance,
Question by:mannoami

Expert Comment

ID: 6933829
Jpg is easily read from the free jpg library. Its in C as I remember. It can read and write many other types as well, I forget the list. Gif is probably not in the list but most of the others are.  Its well written; I hacked it in about 15 min to read and write raw files (just rgb data, no header, no compression)...


Author Comment

ID: 6935927
Jonnin,thanks for ur response.

i know bout the library. i do have it. but actualy i wanna know that how they r written like what method
should i follow to write such programs in C 4 images.

so basically i want a tutorial for such purpose.

Expert Comment

ID: 6936692
The method is to convert raw pixel data (RGB) into a standard file format that you desire. For some formats this is just adding a header or creating a palette, while for others its very complex. The extension tells you the base type, then a header on the type will tell you the subtype (if any), and the image parameters.  

JPG for example uses discrete cosine transfer to reduce the data into regions that compress well (lots of zeros), lots of math but this algorithm is well known and much posted on the web.  Jpg 2000 uses wavelets to do the same; they get more zeros than dct, but same idea.  Wavelets are the way of the future, but intense computations are needed.
Time space tradeoff strikes again...

I don't know of many free resources here, beyond jpg's free stuff. I can recommend books if you have $$ to spend, and programming/math background to understand them (they are not easy for me to understand, I have a math minor for a reference point)...
Note that signal processing pages/books are often really about image processing!

But what you really need is a list of file formats and what goes where in them. I don't know where to get this (no one location really) ...
You will also need the compression/decompression algorithms used in many of the formats, this is avail on the web for most of them.

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 12

Accepted Solution

guidway earned 220 total points
ID: 6977801

here is a site that I found a while back that might help you. Most of the formats are old, but some really are good. Hope this helps,


LVL 12

Expert Comment

ID: 6977806
It isn't the tutorial you asked for, but if you start working with formats then all this has the compression/decompression info of a lot of formats.

LVL 46

Expert Comment

by:Kent Olsen
ID: 9478752
No comment has been added lately, so it's time to clean up this TA.

I will leave a recommendation in the Cleanup topic area that this question is:
Accept guidway's comment as answer

Please leave any comments here within the next seven days.


Kent (Kdo)
EE Cleanup Volunteer

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
The goal of this video is to provide viewers with basic examples to understand and use structures in the C programming language.
The goal of this video is to provide viewers with basic examples to understand recursion in the C programming language.
Suggested Courses
Course of the Month14 days, 23 hours left to enroll

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question