Jump to content
You must now use your email address to sign in [click for more info] ×

Converting Gray to RGB causes Tonal Shift


Recommended Posts

I've been restoring some old B&W images recently, using AP 2.0.4 on a Mac. These photos have been scanned on a flatbed scanner and have the Scanner RGB profile embedded. After doing a lot of edits (spot removal, Curves, channel mixer, sharpening, etc), I try to Convert them to sRGB (with all layers still in tact) and end up with a significant tonal shift when doing so. The attached AP image will illustrate the issue. This image previously had a base layer, a spot removal layer and a Channel Mixer layer. Just as an experiment, I merged those three layers into the background, and I still got this tonal shift when converting to sRGB. The only thing above the background layer are Curves, Clarity and Sharpening layers. The attached image was successfully converted from the RGB scanner profile to Gray/8 using a Generic Gray Profile, which did not cause the tonal shift. Using Gamma 2.2 or D50 profiles did cause the shift. 

The odd thing, is that if I flatten the entire document first, converting from the scanner profile to sRGB works fine and does NOT result in a tonal shift. While that works, I do not want to flatten the images because I want to retain all of my layer work. Also, I want to end up in sRGB because I sometimes colorize these old images. 

Usually, a conversion remaps all the tones and colors so the image "looks" the same after conversion, but this is not the case here. Is this a bug or expected behavior?

Mom - Jim 2-2-1942.afphoto

2017 15" MacBook Pro, 16 MB RAM, Ventura v13.6.6, Affinity Photo/Designer/Publisher v1 & v2, Adobe CS6 Extended, LightRoom v6, Blender, InkScape, Dell 30" Monitor, Canon PRO-100 Printer, i1 Spectrophotometer, i1Publish

Link to comment
Share on other sites

  • Staff

Hi @Ldina,

I am observing the tonal shift when converting your attached file from generic gray to a different greyscale profile or to sRGB which appears to be caused by the 3 live curves adjustments. Merge visible/flattening the curves layers prior to converting the profile significantly reduces the shift, which there may be a logical explanation for. I'll see if I can find out more on why this is occurs and get back to you.

Link to comment
Share on other sites

@NathanC Thank you, Nathan. 

I've been playing around with this some and haven't come to any definitive conclusion so far. I'll provide some extra information, in case it helps.

The scanner assigns "Scanner RGB Profile" to the image automatically (using Apple Image Capture). Scanner RGB Profile (Apple profile) is a 1.8 gamma profile. Converting to other 1.8 gamma profiles leaves the tonality unchanged. Converting to a profile with a different gamma (2.2 gamma, dot gain 20, etc) changes the appearance, at least if there are any Curves Layers above the background layer. 

When exporting a multi-layered document (with curves, other layer adjustments and effects, 1.8 gamma scanner profile, etc) to an sRGB JPG, it converts properly. I'm guessing that your export routine first flattens the image, and THEN coverts from Scanner RGB (1.8 gamma) to sRGB. That works fine and leaves tonality unchanged.

When working on scanned color images, the first thing I usually do is open the file and Assign a Custom Scanner RGB profile to the image, and then Convert to sRGB or another 2.2 gamma RGB editing space. When working on old scanned B/W images that I intend to tone or colorize, I sometimes forget to Assign & Convert up front, since I'm focusing mostly on tonality, noise, image repair, etc...but not on color. Since I want to keep all my layer work in tact, I prefer not to flatten before converting from Scanner RGB to sRGB (or another final destination color space). That's when the problem rears its head. 

I know that Adjustment layers don't always translate well when changing Modes (e.g., LAB to RGB, which have different tone response curves), but I was surprised to see this happen when remaining in RGB.

I hope this extra information is helpful. If you want me to supply more images, Profiles, etc, please let me know. Thanks.

2017 15" MacBook Pro, 16 MB RAM, Ventura v13.6.6, Affinity Photo/Designer/Publisher v1 & v2, Adobe CS6 Extended, LightRoom v6, Blender, InkScape, Dell 30" Monitor, Canon PRO-100 Printer, i1 Spectrophotometer, i1Publish

Link to comment
Share on other sites

  • Staff

Thanks for following up with the extra info, If you could provide me with the scanner RGB ICC profile (if possible) that you have been working with prior to the sRGB conversion and observed shift, along with an .afphoto document with this profile assigned it would be helpful so that we can investigate how this shift is impacted when converting within the RGB colour mode.

If you need a private upload link let me know.

Many thanks!

Link to comment
Share on other sites

@NathanC I've attached a Zip file. It contains the original TIFF Scan with the embedded Scanner profile. I've also included a multilayered AfPhoto file with the same scanner profile embedded in the document. If I try to converted this AfPhoto file to sRGB with all layers in tact, it whacks the tonality and especially the shadows pretty badly. 

The Zip file also contains 4 Apple ICC profiles, three of which are 1.8 gamma, and one of which is 2.2 gamma (some RGB and some Grayscale). I assume these profiles are what Apple routinely assigns to scans when using their Image Capture Scanner Utility, depending on the scan mode chosen by the user. I have so many profiles on my system, it's hard to remember where they all came from! 

Let me know if I can supply anything else. 

Mom and Jim.zip

2017 15" MacBook Pro, 16 MB RAM, Ventura v13.6.6, Affinity Photo/Designer/Publisher v1 & v2, Adobe CS6 Extended, LightRoom v6, Blender, InkScape, Dell 30" Monitor, Canon PRO-100 Printer, i1 Spectrophotometer, i1Publish

Link to comment
Share on other sites

@NathanC After further experimentation and thought, I believe adjustment layers, (and perhaps other effects, filters, etc), are applied using the current color space as their basis. My guess is that when you convert to another color space, the pixels layers are converted accurately, but the adjustment layers (Curves, etc) just pass though as they are and are not recalculated, even if the destination color space has a different gamma. When the conversion is to another color space with a different tonal distribution curve (e.g., 1.8 gamma to 2.2 gamma, dot gain, or Lab) those unaltered adjustment layers are applied without any alteration. Of course, that is not what was intended when the original curves were applied. 

I ran a quick experiment in Photoshop CS6. I opened the scanned file with embedded Scanner RGB Profile, added a strong Curves adjustment layer, then with both layers in tact, I converted to sRGB (which is, more or less, a 2.2 gamma profile). PS also had a tonal shift, when the source and destination profiles had different tone reproduction curves. 

I just wanted to provide some additional information.

2017 15" MacBook Pro, 16 MB RAM, Ventura v13.6.6, Affinity Photo/Designer/Publisher v1 & v2, Adobe CS6 Extended, LightRoom v6, Blender, InkScape, Dell 30" Monitor, Canon PRO-100 Printer, i1 Spectrophotometer, i1Publish

Link to comment
Share on other sites

It would be difficult or practically impossible to do any color profile „conversion“ for adjustment layers, and I would rate it as counter-productive.

in principle, the overall document would need to stay in old profile, and the conversion must be done on the fly as virtual final „change profile“ adjustment on top (think of soft proof adjustment).

In my view the color shift is a logical consequence of having live adjustment layers and unavoidable. 

 

 

Mac mini M1 A2348 | Windows 10 - AMD Ryzen 9 5900x - 32 GB RAM - Nvidia GTX 1080

LG34WK950U-W, calibrated to DCI-P3 with LG Calibration Studio / Spider 5

iPad Air Gen 5 (2022) A2589

Special interest into procedural texture filter, edit alpha channel, RGB/16 and RGB/32 color formats, stacking, finding root causes for misbehaving files, finding creative solutions for unsolvable tasks, finding bugs in Apps.

 

Link to comment
Share on other sites

@NotMyFault Thanks for your response. It probably is difficult to do and probably not worth the effort. I was just a bit surprised when I saw such large tonal shifts, mainly due to converting from a 1.8 gamma space to a 2.2 gamma space while having a lot of adjustment layers on top of the base image. Now that I understand what's going on, I will either convert to my final color space before adding any layer adjustments, or leave it in the original color space and export to TIFF, JPG, PNG, etc if I want a flattened version in a different color space. This will leave my original layer work in tact in the AfPhoto file. I could also save two AfPhoto versions, one flattened and converted, and one with layers in the original color space. 

@NathanC I ran one more experiment, which I think clarifies things for me. I opened an image with the embedded Scanner RGB Profile (1.8 gamma), which I left as it was, just a single background layer. I duplicated that image and created a second document, which I converted to sRGB (basically 2.2 gamma). Side by side, the two versions look identical. I went back to the 1.8 gamma image and added a Curves Adjustment layer to get the image looking like I wanted. I copied that Curves Adjustment Layer from my 1.8 gamma image and pasted it into the sRGB image (2.2 gamma). The two images now have different brightness levels and tonal distribution. This pretty much confirms what we were both seeing, that Adjustment Layers are not recalculated. This can result in changes of tonal distribution AND color, especially if the two color spaces are very different. The pixel layers, however, convert properly. 

I'm sure your team has higher priority things to do, so I'm personally okay if you want to drop this issue. It may not be doable, or worth the effort if it is possible. Thanks for taking note of the subject. I understand what's going on now and can modify my workflow accordingly. 🙂

2017 15" MacBook Pro, 16 MB RAM, Ventura v13.6.6, Affinity Photo/Designer/Publisher v1 & v2, Adobe CS6 Extended, LightRoom v6, Blender, InkScape, Dell 30" Monitor, Canon PRO-100 Printer, i1 Spectrophotometer, i1Publish

Link to comment
Share on other sites

  • Staff

Happy to hear that @Ldina, you've come to the same conclusion as myself in terms of how live adjustments are handled when converting the document colour spaces when compared to a flattened image conversion, I just wanted to make sure nothing else strange/unexpected was going on with your file based on your original post, I appreciate you taking the time to explain your findings and method.

Link to comment
Share on other sites

@NathanC You're welcome. And thank you for looking into it. All is well. 🙂

2017 15" MacBook Pro, 16 MB RAM, Ventura v13.6.6, Affinity Photo/Designer/Publisher v1 & v2, Adobe CS6 Extended, LightRoom v6, Blender, InkScape, Dell 30" Monitor, Canon PRO-100 Printer, i1 Spectrophotometer, i1Publish

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.