1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to read .bmp, .jpeg image in C language?

Discussion in 'C' started by nnhamane, Jul 4, 2008.

  1. nnhamane

    nnhamane New Member

    Joined:
    Jun 23, 2006
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    0
    Is there any inbuilt function in C by which one can directly read or access image?
     
  2. xpi0t0s

    xpi0t0s Mentor

    Joined:
    Aug 6, 2004
    Messages:
    3,012
    Likes Received:
    203
    Trophy Points:
    0
    Occupation:
    Senior Support Engineer
    Location:
    England
    No, C is a very simple language that does not understand the concept of images. You'll need to use a library to access the image; for example you can use the standard file library (fopen etc) if you're happy to handle the format yourself, if not you'll need to get an image manipulation library (if it's a JPG then you'll need a JPG image manipulation library for example).
     
  3. Musab

    Musab New Member

    Joined:
    Jul 1, 2008
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    0
    I have attached the source code to read bmp from my Steganography project.

    Hope it helps.
     
    Last edited by a moderator: Jul 18, 2008
  4. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,285
    Likes Received:
    364
    Trophy Points:
    83
    Musab, For security reasons we would not prefer the code as an attachment. Use the post to explain / post the code.
     
  5. nnhamane

    nnhamane New Member

    Joined:
    Jun 23, 2006
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    0
    Actually i want to read each pixel of image, it may be of any type. For exa take .ppm image file, which contains less information. But i don`t know the exact structure of header or pixel. I am interested in C/C++ only. Plz tell me something about how to open image headers or pixels in C/C++? or tell me any sitename where i can found all information.
     

Share This Page