Results 1 to 4 of 4

Thread: c++ - reading pixels from a file

  1. #1
    Join Date
    Mar 2008
    Beans
    170

    c++ - reading pixels from a file

    Hey, I want to write a program to read a file pixel by pixel, say a jpeg file, but not really sure how to go about it. Does c++ have the ability to do such a thing? Some pointers to related topics would be really appreciated. cheers

  2. #2
    Join Date
    Dec 2007
    Location
    UK
    Beans
    571
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    Re: c++ - reading pixels from a file

    It does, but I dont see why you would want to. Jpegs are one of the trickier image formats to decode, it would be much easier using a library like libjpeg, sdlimage, or magick wand.

    If you want to learn how to decode image files yourself you would be best off studying an uncompressed format such as a bitmap. I wrote my own implementation in C once if thats of any use, you can find it here.

    Have fun.

  3. #3
    Join Date
    Jan 2009
    Location
    Arizona, US
    Beans
    113
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: c++ - reading pixels from a file

    You can but i highly reccomend you get a graphics library to read pixels. (SDL, SFML, Etc)

  4. #4
    Join Date
    Mar 2008
    Beans
    170

    Re: c++ - reading pixels from a file

    Hey, thanks for your responses. I'll have a look through those libraries.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •