Matching raw colors to out of camera JPG

Moderator: jsachs

pawel
Posts: 5
Joined: April 28th, 2009, 4:45 am

Matching raw colors to out of camera JPG

Post by pawel »

How can I develop raw images so that the colors match out of camera JPGs? Would it be possible to allow Color Lookup transformation to reference out of camera JPG and match it against raw file?
jsachs
Posts: 4260
Joined: January 22nd, 2009, 11:03 pm

Re: Matching raw colors to out of camera JPG

Post by jsachs »

Interesting question...

There is no way to do this in general since there are various camera settings that affect only the JPEG file. JPEGs may also include sharpening as well as tonal and color adjustments and distortion correction.

That being said, while none of PWP's current transformations would work, it would be possible to create a new transformation that did this, based on a raw and jpeg image of a standard calibration target such as a ColorChecker or IT8.
Jonathan Sachs
Digital Light & Color
tomczak
Posts: 1372
Joined: April 25th, 2009, 12:56 am
What is the make/model of your primary camera?: Fuji X-E2
Contact:

Re: Matching raw colors to out of camera JPG

Post by tomczak »

A few years ago, in a similar vein, I tried to use Match Reference in PWP7 to pre-process RAW files to look like Fuji-generated in-camera jpegs. I remember that it didn't quite work but I don't remember why.

I believe that the idea was to get JPG+RAW of the Colour Checker, 'develop' RAW mildly - in one standard way, 'correct' both with a Colour Checker, and then use the saved curves (RAW to Corrected) and inverse curves (Corrected to JPG look) to mimic the JPG colour palette - before processing the
RAW further. The goal was to use only RAW files with their adjustment flexibility but still retain the nice Fuji JPG colours (which I could never quite replicate when starting from RAW).
Last edited by tomczak on October 8th, 2022, 1:49 pm, edited 2 times in total.
Maciej Tomczak
Phototramp.com
tomczak
Posts: 1372
Joined: April 25th, 2009, 12:56 am
What is the make/model of your primary camera?: Fuji X-E2
Contact:

Re: Matching raw colors to out of camera JPG

Post by tomczak »

This makes me think: even without Colour Checker, with two matching images - lightly but consistently developed RAW and off-camera JPG - wouldn't it be possible to set some random web or regular grid of several smeared control points on the images, and fit the e.g. least-squares colour curves to match them all as well as possible?

One problem I can see is the lens distortion corrections in JPGs and not in RAW and how to match the two geometrically even if they are of the same scene, but maybe with something like the multipoint Distort to another image (something similar to Multipoint Composite in PWP7, which I dearly miss...) could preempt it?
Maciej Tomczak
Phototramp.com
jsachs
Posts: 4260
Joined: January 22nd, 2009, 11:03 pm

Re: Matching raw colors to out of camera JPG

Post by jsachs »

Unless the reference image spans the full range of RGB colors, the LUT will have blind spots and will not know how to process certain colors. That's why you would need to use a ColorChecker or other standard target.

There is already a lens distortion transformation or you could use a raw converter such as DxO or Lightroom which can remove the distortion automatically.

The more intelligent the algorithm the camera uses to process the raw file, the less useful a LUT will be. Ultimately, while the idea sounds appealing, the execution is bound to fall short and not end up being particularly useful. JPEGs typically have subject-dependent processing of the tonal range and also may do auto color balancing and other color manipulations. The more useful approach is to create custom camera profiles using a standard target, which PWP can do using the Create Profile transformation.
Jonathan Sachs
Digital Light & Color
tomczak
Posts: 1372
Joined: April 25th, 2009, 12:56 am
What is the make/model of your primary camera?: Fuji X-E2
Contact:

Re: Matching raw colors to out of camera JPG

Post by tomczak »

So if the goal is to develop RAW files to approximately match their in-camera JPG versions using a colour target and Create Profile, rather than correcting the image to some standard lighting, how should one go about it?

I could photograph a target in daylight, resulting in RAW+JPG. Then I can develop RAW with minimum adjustments. Then I could create two profiles correcting both to a common corrected output. I'm getting lost as to how to use those profiles to go from RAW to an image resembling the in-camera JPG...
Maciej Tomczak
Phototramp.com
pawel
Posts: 5
Joined: April 28th, 2009, 4:45 am

Re: Matching raw colors to out of camera JPG

Post by pawel »

jsachs wrote: October 8th, 2022, 5:47 am Interesting question...

There is no way to do this in general since there are various camera settings that affect only the JPEG file. JPEGs may also include sharpening as well as tonal and color adjustments and distortion correction.

That being said, while none of PWP's current transformations would work, it would be possible to create a new transformation that did this, based on a raw and jpeg image of a standard calibration target such as a ColorChecker or IT8.
That would be very interesting! I understand it would be very difficult if not impossible to achieve 100% compliance with camera makers JPG processing however I believe that recreating more or less a brightness curve and selected color patches between two images one can reasonably well mimic a given JPG style of the camera.
pawel
Posts: 5
Joined: April 28th, 2009, 4:45 am

Re: Matching raw colors to out of camera JPG

Post by pawel »

tomczak wrote: October 9th, 2022, 5:48 am So if the goal is to develop RAW files to approximately match their in-camera JPG versions using a colour target and Create Profile, rather than correcting the image to some standard lighting, how should one go about it?

I could photograph a target in daylight, resulting in RAW+JPG. Then I can develop RAW with minimum adjustments. Then I could create two profiles correcting both to a common corrected output. I'm getting lost as to how to use those profiles to go from RAW to an image resembling the in-camera JPG...
That's exactly my question, too!

If I understand correctly, Create Profile transformation will create profile designed to eliminate any deviation from the original colors caused by the use of a specific camera model.

I have several ColorChecker Passport Photo photos taken with some of my cameras over the years with and without various JPG settings - what would be the best way to mimic these JPG styles in PWP?
jsachs
Posts: 4260
Joined: January 22nd, 2009, 11:03 pm

Re: Matching raw colors to out of camera JPG

Post by jsachs »

You would need to create a new reference file from the JPEG file that defines the colors and tone scale to which the raw image should be mapped. Then you would use this reference file (instead of the one that come with the target) to build a new profile using the Create Profile transformation. Unfortunately, while it is definitely possible to implement this operation, it is not available in PWP (or anywhere else as far as I know).
Jonathan Sachs
Digital Light & Color
jsachs
Posts: 4260
Joined: January 22nd, 2009, 11:03 pm

Re: Matching raw colors to out of camera JPG

Post by jsachs »

I experimented with creating a new reference file for Create Profile by extracting Lab values from a JPEG image of a test target. The corresponding profile, when applied to a raw image, however did not produce results much different from using the standard reference file, so I think just applying a normal camera profile to raw images combined with some kind of autoranging is close to what you are going to get in terms of replicating the in-camera raw to jpeg conversion, not accounting for the white balance, exposure and other camera settings that affect just the JPEG image.
Jonathan Sachs
Digital Light & Color
Post Reply