C graphics image to JPEG

J

jt

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.
 
R

Richard Tobin

can anybody suggest a code tht would save the graphics image saved in
C to jpg file.
is it available in the net.
[/QUOTE]
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
 
S

soscpd

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.
http://www.google.com

Regards
Rafael
 
C

cr88192

Morris Dovey said:
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...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,123
Latest member
Layne6498
Top