Jump to content
  • Advertisement
Sign in to follow this  
b1gjo3

.CR2 to .BMP or .TIFF?

This topic is 3757 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 Im using a Canon EOS-40D camera, and i have it set to RAW mode which outputs images in .CR2 format. I need to convert this image to something that i can use such as .BMP or .TIFF. I have to preserve as much quality as possible which format should i go with. Also how do i even convert .CR2 to these formats Thanks

Share this post


Link to post
Share on other sites
Advertisement
TIFF uses lossless compression, so I would go with that. I'm not sure if BMPs have native support for compression (I don't think they do, but I could be wrong seeing as many additions have been made to the format). If they do... well, then I'm not sure which would be more suitable.

I'm not familiar with CR2, so I'm not sure how you would convert them, especially since it is a proprietary Canon format. A quick trip to Google should help. ;-)

EDIT: Beaten to the Google punch. :-)

Share this post


Link to post
Share on other sites
Quote:
Original post by GenuineXP
TIFF uses lossless compression, so I would go with that. I'm not sure if BMPs have native support for compression (I don't think they do, but I could be wrong seeing as many additions have been made to the format). If they do... well, then I'm not sure which would be more suitable.


He's right, TIFF would be a bad choice. I think some BMP software supports compression, but most do not. This will cause your images to be HUGE! If you want decent losless compression, PNG is your best bet.

Share this post


Link to post
Share on other sites
thank you for the replies.

i cannot go with a .PNG unfortunately, so i guess im going to have to go with .TIFF. Also i needed a means of converting .CR2 programmatically, without external software, thanks for the google link though. The problem is that once i get it converted to .tiff, how can i get the RGB values from that...

Share this post


Link to post
Share on other sites
BMP only supports run-length compression, which isn't particularly useful for photos or other vaguely realistic images.

For most practical purposes BMP is a raw image with a header stuck on it.

Share this post


Link to post
Share on other sites
Photoshop opens CR2 (mine does anyways), save as TIFF as it support 16 bit per color.
Or save in Photoshops native format.

Share this post


Link to post
Share on other sites
I found a library called LibRaw that converts CR2 files to PPM and TIFF

heres some sample source code to convert CR2 to TIFF


//this code requires to include library - libraw.lib
//and header libraw.h

//code to convert CR2 to TIFF
LibRaw iProcessor = NULL;
iProcessor.open_file(".\\IMG_0001.CR2");
iProcessor.unpack();
iProcessor.imgdata.params.use_camera_wb = 1;
iProcessor.imgdata.params.output_tiff = 1;
iProcessor.dcraw_process();
iProcessor.dcraw_ppm_tiff_writer("x.tiff");
iProcessor.recycle();




i hope this helps for people looking to do the same thing

[Edited by - b1gjo3 on June 17, 2008 4:20:01 PM]

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!