Thread: image convertion jpg -> pgm

  1. #1
    Registered User AtomRiot's Avatar
    Join Date
    Jan 2003
    Posts
    120

    image convertion jpg -> pgm

    i am looking for something that i can read in a .jpg file and convert it to a pgm file then write that file, does anyone know anythign like this. i have looked at many libraries and most of them do a crap load of stuff but they dont end up working anyhow. i just need this simple task, and i would preffer to program it but i do not know how to go about this but i thought that there might be something our there that can guide me along the way. i am using msvc++ and the end product will be done in win32 api but for now this part can be done in dos until i get something working. any input would be awsome.
    All Your Base Are Still Belong to Someone!!!
    And you Remember that!!!

  2. #2
    Code Monkey Davros's Avatar
    Join Date
    Jun 2002
    Posts
    812
    I believe PGM is a unix greyscale bitmap format, no wonder you cannot find many/any Windows toolkits which support it.

    However, I found this link for you, which describes the PGM file format.

    http://www.cs.ubc.ca/spider/ladic/text/pgm.txt
    Last edited by Davros; 02-01-2003 at 05:58 AM.
    OS: Windows XP
    Compilers: MinGW (Code::Blocks), BCB 5

    BigAngryDog.com

  3. #3
    Registered User
    Join Date
    Jan 2003
    Posts
    37
    I have an e-book and there is a section to convert a PNG to bitmap if that is any good to you. The book is 13.5MB and is for Borland C++ Builder.

    Let me know if you want it.

  4. #4
    Registered User AtomRiot's Avatar
    Join Date
    Jan 2003
    Posts
    120
    well, what i need is the pgm file format, i know what structure it is in its just the opening and decompressing the jpg thats a problem
    is there a way just to convert the jpg to raw data? and yes i have found tuns of linux / unix applications and source but unfortunately the people that pay my do not need / use linux / unix so i am out of luck there.
    All Your Base Are Still Belong to Someone!!!
    And you Remember that!!!

  5. #5
    I lurk
    Join Date
    Aug 2002
    Posts
    1,361
    http://www.wotsit.org
    The JPEG specification has code for decompressing and compressing JPEGs with it. Have fun!

  6. #6
    Registered User AtomRiot's Avatar
    Join Date
    Jan 2003
    Posts
    120
    thanks i will give it a look
    All Your Base Are Still Belong to Someone!!!
    And you Remember that!!!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem reading tiff image files?
    By compz in forum C++ Programming
    Replies: 9
    Last Post: 10-30-2009, 04:17 AM
  2. Replies: 1
    Last Post: 05-27-2009, 12:46 PM
  3. small -> big -> bigger -> bigger than bigger -> ?
    By happyclown in forum A Brief History of Cprogramming.com
    Replies: 9
    Last Post: 03-11-2009, 12:12 PM
  4. How to write image data to binary PGM file format(P5)?
    By tommy_chai in forum C Programming
    Replies: 6
    Last Post: 11-03-2007, 10:52 PM
  5. how to convert a bitmap image to a jpg image file using C++?
    By nomer in forum Windows Programming
    Replies: 4
    Last Post: 06-04-2006, 07:40 PM