Unoffical empeg BBS

Quick Links: Empeg FAQ | RioCar.Org | Hijack | BigDisk Builder | jEmplode | emphatic
Repairs: Repairs

Topic Options
#285284 - 10/08/2006 00:58 Comparison: in-camera-JPG vs. RAW-to-JPG
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14496
Loc: Canada
I take a lot of photographs.

My main camera is currently a Canon 20D digital SLR camera, with lots of shiny lenses in the arsenal.

For convenience, I have normally had the camera set to produce the best quality JPG files that it can do. But it has always looked somewhat lackluster.

Recently, I've also had the camera simultaneously producing RAW files (more or less a dump from the sensors, with very minimal in-camera processing -- the opposite of a JPG file). These are huge, ugly files, that require much care and tending to convert (or "develop") into usable prints -- which is all that I've used them for (printing).

Just for fun today, I reprogrammed my website scripts to reprocess the RAW files and create JPGs from them, instead of just using the JPGs that the camera itself provides. This is totally automated and DUMB -- no special care or human intervention per-photo. I'm using the dcraw program, something I've been twiddling with from time-to-time for a few years now.

The results? Here are some (much downsized) samples from this past weekend.

The full-size (8mp) files are even more impressive, but I think these thumbnails still tell the story.

I'm convinced. From now on, the camera will be set for RAW only, rather than RAW+JPG. The JPGs will get generated later by the automated scripts.


Edited by mlord (10/08/2006 01:22)

Top
#285285 - 10/08/2006 04:15 Re: Comparison: in-camera-JPG vs. RAW-to-JPG [Re: mlord]
Cybjorg
addict

Registered: 23/12/2002
Posts: 652
Loc: Winston Salem, NC
I take all my photos in RAW, but I process them through Adobe Photoshop's Camara RAW extension. Adobe Bridge has automatic processing built in, but it doesn't do that great of a job.

Top
#285286 - 10/08/2006 04:19 Re: Comparison: in-camera-JPG vs. RAW-to-JPG [Re: mlord]
andy
carpal tunnel

Registered: 10/06/1999
Posts: 5916
Loc: Wivenhoe, Essex, UK
I wonder if the obvious colour improvements could also have been achieved using the on camera colour and saturation adjustments ?
_________________________
Remind me to change my signature to something more interesting someday

Top
#285287 - 10/08/2006 04:35 Re: Comparison: in-camera-JPG vs. RAW-to-JPG [Re: mlord]
andy
carpal tunnel

Registered: 10/06/1999
Posts: 5916
Loc: Wivenhoe, Essex, UK
What commandline arguments are you using Mark ? I have just given dcraw a quick go and it is blowing more highlights than the in camera processing does.

Also, are you applying a separate step to sharpen the images. The images coming out of dcraw are somewhat soft compared to my jpegs.
_________________________
Remind me to change my signature to something more interesting someday

Top
#285288 - 10/08/2006 05:01 Re: Comparison: in-camera-JPG vs. RAW-to-JPG [Re: mlord]
matthew_k
pooh-bah

Registered: 12/02/2002
Posts: 2298
Loc: Berkeley, California
Yup, the ability to recover blown highlights is why I shoot raw. It's so convenient to see the spiked histogram, pull the exposure slider down half a stop, and watch the detail emerge in the highlights. I use aperture because it is so convenient, but I experimented with DCraw and seriously considered building a system similar to yours before Aperture came out.

Matthew

Top
#285289 - 10/08/2006 12:30 Re: Comparison: in-camera-JPG vs. RAW-to-JPG [Re: andy]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14496
Loc: Canada
Quote:
What commandline arguments are you using Mark ? I have just given dcraw a quick go and it is blowing more highlights than the in camera processing does.


My camera seems to have a habit of blowing highlights, whereas dcraw (version 1.340) seems to do well at preserving them. The camera is set to Adobe colour space, which (in theory) makes no difference for RAW files.

I am creating "equivalent" full size JPG files using this:

dcraw -c -w -H 0 -o 1 xxxxx.cr2 | cjpeg -quality 98 -optimize -progressive > xxxxx.jpg

I'm not sure, but the -H 0 -o 1 flags may be the same as the defaults.

Quote:
Also, are you applying a separate step to sharpen the images. The images coming out of dcraw are somewhat soft compared to my jpegs.


Yeah, no sharpening at all this way. I'm still looking for a nice solution to that -- there must be something in the netpbm package that does it, but I have not yet found it.

Cheers

Top
#285290 - 10/08/2006 12:33 Re: Comparison: in-camera-JPG vs. RAW-to-JPG [Re: matthew_k]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14496
Loc: Canada
Quote:
Yup, the ability to recover blown highlights is why I shoot raw.


Yes, that and fixing the white balance.

But this particular comparism is of a different vein.. we're comparing in-camera JPG-from-RAW with out-of-camera JPG-from-RAW, both automated without any attention to the qualities of a particular image. Given the same quality of RAW conversion in both places, the results should not be as far apart as I'm observing here!

It's certainly nice to have lots of options for this stuff!

Cheres

Top
#285291 - 10/08/2006 12:34 Re: Comparison: in-camera-JPG vs. RAW-to-JPG [Re: andy]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14496
Loc: Canada
Quote:
I wonder if the obvious colour improvements could also have been achieved using the on camera colour and saturation adjustments ?


I don't think so. The camera was producing dull and lifeless images with blown highlights. In the past, I've tried bumping up the in-camera saturation/contrast a notch, and it simply gave more blown highlights, and way-overdone reds and oranges.

Cheers

Top
#285292 - 10/08/2006 13:00 Re: Comparison: in-camera-JPG vs. RAW-to-JPG [Re: mlord]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14496
Loc: Canada
Quote:

Quote:
Also, are you applying a separate step to sharpen the images. The images coming out of dcraw are somewhat soft compared to my jpegs.


Yeah, no sharpening at all this way. I'm still looking for a nice solution to that -- there must be something in the netpbm package that does it, but I have not yet found it.


Ahh.. here we go

I'm still tweaking, but something like this is getting close:

convert junk.ppm -unsharp 3.5x1.2+1.5+0.10 junk.jpg

Cheers

Top
#285293 - 10/08/2006 13:25 Re: Comparison: in-camera-JPG vs. RAW-to-JPG [Re: mlord]
Phoenix42
veteran

Registered: 21/03/2002
Posts: 1424
Loc: MA but Irish born
WOW
Quite a differance.

A quick google shows the dcraw is also available for windows, is the command line the same?

Top
#285294 - 10/08/2006 14:29 Re: Comparison: in-camera-JPG vs. RAW-to-JPG [Re: Phoenix42]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14496
Loc: Canada
Quote:

A quick google shows the dcraw is also available for windows, is the command line the same?


It should be.

Top
#285295 - 10/08/2006 14:33 Re: Comparison: in-camera-JPG vs. RAW-to-JPG [Re: mlord]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14496
Loc: Canada
Mmm.. no, I cannot get the convert -unsharp to work the way I want without it dropping red speckles all over the image. Still need a solution for that someday.

Meanwhile, there's a contrast curve adjustment in that package which does help a lot:

dcraw -c -w -H 0 -o 1 xxxxx.cr2 | convert ppm:- -sigmoidal-contrast 3x50% -quality 98 -interlace plane xxxxx.jpg

Pretty good for being totally automated. I'd still like a touch of unsharp masking, though.

Cheers

Top
#285296 - 10/08/2006 14:41 Re: Comparison: in-camera-JPG vs. RAW-to-JPG [Re: mlord]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31600
Loc: Seattle, WA
Very nice. So what is the bit depth per color channel for the raw images?

I'm guessing that's the reason you're getting so much better results... The JPGs can only do 8 bits per color channel, while the raw images are doing more than that, thus the better dynamic range, and your postprocessing does a better job of bringing out that dynamic range than the in-camera processing does.
_________________________
Tony Fabris

Top
#285297 - 10/08/2006 14:48 Re: Comparison: in-camera-JPG vs. RAW-to-JPG [Re: tfabris]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14496
Loc: Canada
Quote:
Very nice. So what is the bit depth per color channel for the raw images?


I think the camera has about 12-bits per channel in the RAW data.
Quote:

I'm guessing that's the reason you're getting so much better results... The JPGs can only do 8 bits per color channel, while the raw images are doing more than that, thus the better dynamic range,


The output is still JPG (8-bits/channel) in both cases, and both methods use the RAW data to create the JPG..
Quote:

and your postprocessing does a better job of bringing out that dynamic range than the in-camera processing does.


Yes. But for a non-tweaked process, I really expected the camera to do a similarly good job, expecially since it has more info available to it than what dcraw has (all of the proprietary Canon extra stuff from the RAW data).

Oh well.

Cheers

Top
#285298 - 10/08/2006 16:55 Re: Comparison: in-camera-JPG vs. RAW-to-JPG [Re: mlord]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14496
Loc: Canada
Ahh.. sharpening now works, with convert -sharpen 0x1.0 inserted into the pipeline. Or smaller values (0x0.5) for the smallest sizes.

Cheers

Top
#285299 - 10/08/2006 18:10 Re: Comparison: in-camera-JPG vs. RAW-to-JPG [Re: mlord]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14496
Loc: Canada
Here's my final pipeline. Now I just need a supercomputer or two to help speed up regenerating all of the photos on my site that have raw files..

dcraw -c -w -H 0 -o 1 xxxxxxxx.cr2 | convert ppm:- -sigmoidal-contrast 3x50% -sharpen 0x1.2 ppm:- | cjpeg -quality 97 -optimize -progressive > xxxxxxxx.jpg

Cheers

Top
#285300 - 10/08/2006 18:12 Re: Comparison: in-camera-JPG vs. RAW-to-JPG [Re: mlord]
RobotCaleb
pooh-bah

Registered: 15/01/2002
Posts: 1866
Loc: Austin
How long does it take to process one photo?

Top
#285301 - 10/08/2006 18:43 Re: Comparison: in-camera-JPG vs. RAW-to-JPG [Re: RobotCaleb]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14496
Loc: Canada
Quote:
How long does it take to process one photo?


Slightly variable, but I just now timed one at 36 seconds -- to generate just a full size JPG from the RAW file as above. For my website, I also have it generate four other sizes of each picture, taking an extra 8 seconds or so (total) per photo.

(2.0GHz Pentium-M, accessing the photos across the network)

Cheers


Edited by mlord (10/08/2006 18:45)

Top
#285302 - 10/08/2006 19:40 Re: Comparison: in-camera-JPG vs. RAW-to-JPG [Re: mlord]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31600
Loc: Seattle, WA
Quote:
But for a non-tweaked process, I really expected the camera to do a similarly good job

Oh really? Considering this...?

Quote:
How long does it take to process one photo?
Slightly variable, but I just now timed one at 36 seconds

See, that's why the camera doesn't do a good job at it. If the camera did that good a job internally, you could take one photo every 36 seconds.

To be truthful, I'm surprised some of these cameras are as quick as they are, especially the newest canons. The chips they've got with built-in JPG encoding/decoding do a surprisingly quick job. Well, now we know one of the reasons why.
_________________________
Tony Fabris

Top
#285303 - 10/08/2006 20:24 Re: Comparison: in-camera-JPG vs. RAW-to-JPG [Re: tfabris]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14496
Loc: Canada
Quote:
Quote:
But for a non-tweaked process, I really expected the camera to do a similarly good job

Oh really? Considering this...?

Quote:
How long does it take to process one photo?
Slightly variable, but I just now timed one at 36 seconds



The camera has a rather large custom chip to do RAW -> JPG conversions, which is where the speed comes from. But they don't seem to have configured it with optimal curves and other parameters I guess.

Cheers

Top
#285304 - 10/08/2006 20:34 Re: Comparison: in-camera-JPG vs. RAW-to-JPG [Re: mlord]
matthew_k
pooh-bah

Registered: 12/02/2002
Posts: 2298
Loc: Berkeley, California
Quote:
The camera has a rather large custom chip to do RAW -> JPG conversions

Right, custom silicon should be loads faster than an all purpose CPU. And considering they designed the thing, they should be able to get every last bit of dynamic range out of the sensor.

Matthew

Top