[Ubuntu] Converting CR2 to JPG

I’ve received about 300 images in CR2 (Canon raw image format) and wanted to convert it to jpg.
Here is a solution working on Ubuntu 12.04 LTS:

  1. Install  libjpeg-turbo-progs, dcraw and ufraw.
  2. You can use ufraw for displaying and enhancing a single image.
  3. If you want to convert large number of files you can use following Perl script with dcraw tool:
    opendir (DIR, ".");
    @files= readdir(DIR); 
    foreach $file (@files){
    	next unless $file =~ /([^\.]*)\.CR2$/; 
    	print "Converting $file\n";
    	system("dcraw -c $file | cjpeg > $1.jpg");
This entry was posted in Ubuntu and tagged , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *