topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Saturday December 14, 2024, 8:27 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Question concerning a program for converting RAW pictures to PGM file formats...  (Read 6329 times)

Renox

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 58
    • View Profile
    • Donate to Member
Ok, so... I am writing a nice little utility to convert a RAW picture file to a PGM file. Everything works great. Coding came out nice and it does exactly what I need it to do. However, I was wondering if there is anyway to convert a PGM file to JPEG format using C.

Renox

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 58
    • View Profile
    • Donate to Member

gjehle

  • Member
  • Joined in 2006
  • **
  • Posts: 286
  • lonesome linux warrior
    • View Profile
    • Open Source Corner
    • Read more about this member.
    • Donate to Member
i sure hope you used dcraw for raw conversion, otherwise you might have re-invented the wheel

the basic idea for image conversion usually is:
- load format x (this should give you a bitmap)
- convert said bitmap to destination format y

i recommended using libjpeg (http://freshmeat.net/projects/libjpeg/)
just spare yourself the effort of reinventing the wheel :P

esp. for image processing algorithms the already existing solution is magnitudes
better/faster than what you would come up with.
unless you're a image processing god, or the problem is very special ;-)

Renox

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 58
    • View Profile
    • Donate to Member
Thank you very much for the reply. I was wondering if anyone knew how to do this. I did, unfortunately re-invent the wheel so to speak.... I wanted to understand the data flow of the arrays for the actual image and the template it holds. I am still playing with things...

gjehle

  • Member
  • Joined in 2006
  • **
  • Posts: 286
  • lonesome linux warrior
    • View Profile
    • Open Source Corner
    • Read more about this member.
    • Donate to Member
well, it is a good thing to know how stuff works
sadly, most of the time one doesn't have the time (or virtue) to dig into the details.
esp. if you're coding stuff at work where money and time matters ;-)