CR2 RAW file conversion

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
jose.sanpedro
Posts: 14
Joined: 2015-02-10T11:30:35-07:00
Authentication code: 6789

Re: CR2 RAW file conversion

Post by jose.sanpedro »

well, i toke a better look and your code generates a better result. colors are better. but still different that the original, but i think i can work with this. thanks!
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: CR2 RAW file conversion

Post by snibgo »

If you are doing further processing, don't write to JPG. Use another format such as PNG or TIFF, with compression none or LZW or ZIP.

If you simply want a JPG image, you could just use the JPEG preview that is embedded in the CR2 file.
snibgo's IM pages: im.snibgo.com
jose.sanpedro
Posts: 14
Joined: 2015-02-10T11:30:35-07:00
Authentication code: 6789

Re: CR2 RAW file conversion

Post by jose.sanpedro »

how can i use the jpeg preview embedded in the cr2 file? i need jpeg output
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: CR2 RAW file conversion

Post by snibgo »

1. List metadata from exiftool:

Code: Select all

exiftool -s2 -all -b -X -fXMP:XMP foto.cr2
2. Near the bottom, it shows:

Code: Select all

 Composite:PreviewImage='(Binary data 1706501 bytes, use -b option to extract)'
 Composite:ThumbnailImage='(Binary data 17031 bytes, use -b option to extract)'
3. Use the "-b" option to extract either or both:

Code: Select all

exiftool -Composite:PreviewImage -b foto.cr2 >preview.jpg

exiftool -Composite:ThumbnailImage -b foto.cr2 >thumb.jpg
snibgo's IM pages: im.snibgo.com
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: CR2 RAW file conversion

Post by Bonzo »

You can get the jpg preview using Imagemagick as well as I did it a few years ago, but can not remember how. I am sure I posted on a thread about it on the forum.
From memory it is in the EXIF data as snibgo said.
jose.sanpedro
Posts: 14
Joined: 2015-02-10T11:30:35-07:00
Authentication code: 6789

Re: CR2 RAW file conversion

Post by jose.sanpedro »

thanks snibgo! thats awesome...just what i needed! :D
Post Reply