I'm working on an photo upload app and need to allow users to upload raw files from cameras (these are not jpegs) and have the server automatically create a jpeg version of them. I currently have Imagemagick installed but I don't think there is a way to do it in there.
Cameras come out with new raw formats all the time, so im looking for something that will be relativley up-to-date and command php exec() is an option too.
Does anyone have anything to suggestion for raw conversion?
Convert your file Open the photos in RAW format, e.g. in Photoshop. Go to 'File' and choose 'Save As' and select from the list '. jpg' (it might appear as JPEG). Choose a compression between 90-100%, otherwise this leads to loss of quality.
No. In order to work with images you shot in a RAW format in GIMP, you'll need a RAW converter to first change them to something that GIMP can read, like TIFF or JPG.
To convert a RAW file to a JPEG image file, open your RAW file in your chosen editing software. From there, simply make a copy of the file, save, and export it as a new JPEG image file. You'll then have two files — the original RAW file and the converted JPEG image.
Actually, as you can see in this list, ImageMagick does support RAW photos: http://www.imagemagick.org/script/formats.php (e.g. .NEF nikon photos and .CR2 canon photos).
Example code for a .CR2 photo:
$im = new Imagick( 'source.CR2' );
$im->setImageFormat( 'jpg' );
$im->writeImage( 'result.jpg' );
$im->clear();
$im->destroy();
Even easier to
sudo apt-get install ufraw ufraw-batch
then either use UFRaw (see man pages) or use ImageMagick which uses UFRaw
convert mypic.RAF mypic.jpeg
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With