views:

160

answers:

7

Hello,

I'm thinking to build a library to manipulate images(my own image type that I will develop), but first I need to understand the structure of a image

  • How it is mounted?
  • About the layer technology...
  • Where I can find some good resources to understand these things?

Thanks.

A: 

Each image format, has a differant structure and comprresion.

Maybe you should explain in more detail your goals.

Pino
+5  A: 

That all depends on the image format in question.

Most image formats, however, consist of the following:

  • A header that contains general file information (how long, what format, dimensions, color space, compression algorithm, etc.)
  • The pixel data (potentially compressed, in which case some other structure may apply)
  • Other metadata (EXIF, ...)

Many popular image formats such as JPEG or PNG have freely available specifications of the file format.

If you actually want to work with more complex images, containing layers and such (possibly Photoshop or similar) then things get more difficult. They additionally contain layers, so multiple chunks of pixel data, maybe metadata for the layers, in the case of Photoshop even vector data (for layer masks and other paths), etc.

What's more, most primary file formats used by major proprietary image editing software tend to be not fully specified, at least not publicly. There are resources out there but expect them to be incomplete at best.

Still, starting a project like this without much prior knowledge of image file formats in general might not be a feasible idea.

Joey
The thing is that my library will be developed to support a image format that I will create.
Nathan Campos
*blinks* so your question is more about how to conceive an image format and the question about the library should come later?
Joey
+1  A: 

Image file formats vary wildly. However, depending on which language/platform you're coding against, you may have generalized means of working with images and translating them into the format you chose. Each platform will have its own means of building and accessing images, however, so there's little I can tell you of substance without a declaration of your programming platform of choice.

Personally, I prefer C#/.NET. So here are some links on image manipulation in that platform:

http://www.aspfree.com/c/a/C-Sharp/Basic-Image-Manipulation-using-GDI-and-C/ http://www.aspfree.com/c/a/Code-Examples/Handling-Animation-and-Bitmaps-Using-GDI-for-Image-Manipulation/

Randolpho
+1 - C# is a very good language that I also develop with, but my project will not be in C#, sorry.
Nathan Campos
A: 

A quick amazon search yields a couple of books that could be very useful on the subject. Both are based around openGL, one of the most common graphic libraries. The first is a general introduction to computer graphics sort of text book and the second is a manual for openGL (commonly known as the red book).

Computer Graphics with OpenGL (3rd Edition)

OpenGL Programming Guide (The Red Book)

I can personally attest to the usefulness of both books.

Daniel Bingham
A: 

If you're interested in the innards of various image file formats wotsit is a pretty good start. If you prefer hardcopy then go to the Encyclopedia of Graphics file formats. And if you want to look at sample sourcecode check out imagemagick. It can open-, convert to-, and save- most popular image file formats written in C++ with interfaces to most other languages.

jilles de wit
A: 

Unless you're doing something very unique, I would encourage you to use an existing file format. Look at PNG or TIFF. They are incredibly flexible.

As a veteran in the field, I would say that the last thing the world needs is a new image file format. ;-)

iamopie
+2  A: 

A good start to everyone that needs to know the basics about digital images is the chapter 2 of the classic book by Gonzalez and Woods, Digital Image Processing.

A short answer, roughly speaking: for manipulation in memory, images are 2D arrays. There are lots of variants, but the 2D array is the classic way.

For C, C++ and Python, take a look on OpenCV. For Python, see PIL. For Java, see JAI. Finally, to a overview about an "image structure", take a close look inside IplImage structure in OpenCV documentation.

TH
lol, um brasileiro! Eu também sou, mas moro no Espirito Santo! :D
Nathan Campos
Yeah, but keep the conversation in English. People at Stackoverflow probably will dislike a "crazy Brazilian invasion" as that happened at Orkut :P
TH