Showing posts with label jpeg. Show all posts
Showing posts with label jpeg. Show all posts

Friday, May 10, 2013

How do I extract an embedded JPEG from a RAW file?

Short answer:


exiftool -b -JpgFromRaw IMG0001.NEF > test.jpg

Long answer:

Most RAW files contain not only the raw data that was captured when the picture was taken, but also a jpeg file which can be used to quickly show the image before the RAW has been completely interpreted.

Some programs that pretend to handle RAW files actually just extract the jpeg and displays that one to the user.

There is rarely any reason to extract the jpeg manually, but if you want to, you can use the command tool above using exiftool which is a tool available for Windows, Mac OS and Unix/Linux.

Just replace "IMG0001.NEF" with the name of your RAW file and "test.jpg" with the name of the jpeg you want to create.

Update: The name of the preview is not the same for all RAW files. That's why Jener in the comment section succeeds with PreviewImage but not with JpgFromRaw. In general, if you have problems with the command, try the exiftool documentation page

Saturday, July 12, 2008

What's the JPEG compression level?

When you save a file as jpeg you usually get an option to choose the compression or quality level. To know which level to choose you have one single reliable source: your own experience.

I did some experiments with a 2 Megabyte tiff file and measured the size when exported from different applications. The sizes varied widely between each application. Note that the only thing that can be measured absolutely is the file size - not the file quality. Quality can vary even more. The test was done with one single file. Other files may show very different behaviour.

Aperture and Photoshop have a scale from 0 to 12. An Aperture 12 jpeg was bigger than Photoshop 12. On the other hand, Aperture 0 was smaller than Photoshop 0, so Aperture's spread was wider.

Photoshop has a "Save for web..." option that increases the compatibility of the files. Here, the scale confusingly goes from 0 to 100. Both of those values are smaller than the corresponding files that result from "Save as..." in Photoshop with the settings 0 and 12.

Capture NX also goes from 0 to 100. It's 0 value is unusable, but Photoshop's 0 quality files, which are smaller, might work in some low requirement circumstances.

The gimp also goes from 0 to 100. It's 0 value quality looks like a bad computer game for a character based DOS program from the 1980ies, but it also is the smallest of them all.

All high quality jpegs look decent of course.

Numbers

Highest quality jpegs in each application: Aperture (1.1 M), Preview (1.1 M), Photoshop (912 k), Photoshop saved for web (780 k), Capture NX (712 k), gimp (644 k).

Lowest quality jpegs in each application: gimp (12 k), Photoshop saved for web (48 k), Capture NX (60 k), Preview (72 k), Aperture (76 k), Photoshop (88 k).

Lowest quality jpeg in Photoshop

Lowest quality jpeg in the gimp

Resizing JPEG, TIFF and PSD in Mac OS X

To resize pictures it is usually safest to use an application like Photoshop or the gimp to do it, to keep control of what is happening.

However, in Mac OS X 10.5 (Leopard) one can also automatise resizing directly without any additional applications. The blog PagesFAQ describes how to do it with AppleScript or Automator.