• Advertisement
Sign in to follow this  

Saving images using JPEG file format

This topic is 2449 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello everyone.

I'm implementing in our engine the possibility of taking screen captures. This is very easy to get the raw data from the frame buffer. The problem is, i would like to be able to save the image in JPEG format because of the compression and this is a better file format for exchanges.

I have worked with lib JPEG before. This is a good library and it is very easy to used. However, it is a bit big. NVIDIA has a tool for opening jpeg that is very small (it's only a .h and a .cpp) called JPEGLoader.h/cpp. Unfortunatly, i wasn't able to find the writter conterpart.

Does anyone know about a small (even restricted) C++ JPEG compressor ?

Thanks

Share this post


Link to post
Share on other sites
Advertisement
If you're coding on Windows you can use GDI+ to save a JPEG. If you're using D3D then there are some nice functions available to save surfaces in multiple image formats. Otherwise I honestly wouldn't worry about executable size; there's a "bloatware" myth that bigger executables are somehow slower, and it's actually just that - a myth.

Share this post


Link to post
Share on other sites
Thank you guys for your replies.

I work on both Windows and MAC OSX so platform specific APIs such as D3D and GDI+ are, unfortunatly, a luxury i can't afford. I'm not worried about the size of the executable file, it is more a matter of keeping the code base as lean and mean as possible.

Devil looks like an interesting lib we could use for the tool artists will use.

For writting jpeg, i guess i'll use libjpeg. Maybe i'll try to write and encoder if i have the time.


Thanks again.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement