C graphics image to JPEG

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • jt

    C graphics image to JPEG

    hey guys..
    can anybody suggest a code tht would save the graphics image saved in
    C to jpg file.
    is it available in the net.
    plz tell the links.
  • Jens Thoms Toerring

    #2
    Re: C graphics image to JPEG

    jt <karthiks.840@g mail.comwrote:
    can anybody suggest a code tht would save the graphics image saved in
    C to jpg file.
    is it available in the net.
    Just search for "libjpeg" and one of the first results is


    Regards, Jens
    --
    \ Jens Thoms Toerring ___ jt@toerring.de
    \______________ ____________ http://toerring.de

    Comment

    • Morris Dovey

      #3
      Re: C graphics image to JPEG

      jt wrote:
      hey guys..
      can anybody suggest a code tht would save the graphics image saved in
      C to jpg file.
      is it available in the net.
      plz tell the links.
      If you already have the data in your C program, all you need to do is
      use fopen() to open the file, fwrite() to move the data into the file,
      and fclose() to finish.

      Much easier than you were expecting, yes?

      --
      Morris Dovey
      DeSoto Solar
      DeSoto, Iowa USA

      Comment

      • Richard Tobin

        #4
        Re: C graphics image to JPEG

        In article <68e61sF2s5ihaU 2@mid.uni-berlin.de>,
        Jens Thoms Toerring <jt@toerring.de wrote:
        >can anybody suggest a code tht would save the graphics image saved in
        >C to jpg file.
        >is it available in the net.
        >Just search for "libjpeg" and one of the first results is
        >
        >http://www.ijg.org/
        And you quite likely already have a JPEG library on your computer,
        so you may not need to install it.

        -- Richard
        --
        :wq

        Comment

        • soscpd@terra.com.br

          #5
          Re: C graphics image to JPEG

          On May 7, 12:08 pm, jt <karthiks....@g mail.comwrote:
          hey guys..
          Heey Jt... what's up? :)
          can anybody suggest a code tht would save the graphics image saved in
          C to jpg file.
          Save what "graphics"? Where? Isn't that already saved on the jpeg
          file? Damn graphics...

          You probably need to know more about the subject to improove your
          question. Try to figure what exactly you wish to do with the image
          data (there is a little universe here, and people can only guess.
          Maybe you wish to use the pixel's RGB some way, some where. Who
          knows?). Then, figure if the provided link (donw in the message body)
          doesn't show you up some light. Then, as you already know (I presume)
          what you have to do, try to know more about the stuff this guys have
          on this site - http://www.ijg.org. If the final result left any
          questions about the C implementation of your project, after search
          again with this new subject in the down link, you can post your
          question with more chances to get from me, at least, a answer usefull
          to your project.
          is it available in the net.
          I am sure it is, and you will find out, soon as you know what you are
          looking for. To be honest, this task is far away the hard one in (my
          experience) all projects.
          plz tell the links.
          Jt.... you didn't save that much time. Write the whole word. Please.


          Regards
          Rafael

          Comment

          • Malcolm McLean

            #6
            Re: C graphics image to JPEG

            "jt" <karthiks.840@g mail.comwrote in message news:
            hey guys..
            can anybody suggest a code tht would save the graphics image saved in
            C to jpg file.
            is it available in the net.
            plz tell the links.
            >
            The code you are looking for is on my website. More or less. You'll probably
            want to play about with the compression ratio by manipulating the
            quantisation.

            Look under Basic Algorithms, sample code.

            --
            Free games and programming goodies.


            Comment

            • cr88192

              #7
              Re: C graphics image to JPEG


              "Morris Dovey" <mrdovey@iedu.c omwrote in message
              news:4821e36f$0 $89866$815e3792 @news.qwest.net ...
              jt wrote:
              >hey guys..
              >can anybody suggest a code tht would save the graphics image saved in
              >C to jpg file.
              >is it available in the net.
              >plz tell the links.
              >
              If you already have the data in your C program, all you need to do is use
              fopen() to open the file, fwrite() to move the data into the file, and
              fclose() to finish.
              >
              Much easier than you were expecting, yes?
              >
              if you have a valid jpeg bitstream in the buffer, but if it is actual
              graphical data (say, an image rendered into a buffer), then a little more is
              needed than this.

              as noted by others, IJG's libjpeg is a common option for loading/saving jpeg
              files.

              at least a few of us here have written custom load/save code as well (the
              advantage of going this route is that one can do a single-file
              implementation of the thing and avoid the dependency/liscense/bulk/...
              issues involved with using a 3rd party library).

              of course, be warned that writing code to encode/decode a jpeg bitstream
              isn't exactly a newbie friendly task (at least a few of us are probably also
              likely to make such code available on request as well).

              my particular case:
              I can send my version if asked via email.


              I have been using it fairly effectively for both encoding and decoding for a
              few years now.

              it also has a faster encoder (lower quality/conpression tradeoff), which was
              tweaked mostly for the task of encoding images to be used in MJPEG videos
              (basically, when I was trying to minimize the performance impact when doing
              real-time video recording/encoding in my apps, albeit glReadPixels is the
              main bottleneck IME).

              or such...

              --
              Morris Dovey
              DeSoto Solar
              DeSoto, Iowa USA
              http://www.iedu.com/DeSoto/

              Comment

              Working...