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

Recommended Posts

Hello, I was applying the lab method for sharpening to an image, here are the stepsI took

 

Converting from adobe rgb / 8 to Lab 16

Select brightness channel -> load pixel selection

Invert selection

unsharp mask radius 0.5 factor 1

deselect

reset channels

conversion from Lab16 to adobe rbg / 8

 

I have been using this method for a long time but only tonight I noticed that once I did these steps when I return to rbg / 8 the colors are completely different

I attach an affinity file with the three outputs

Abobe rgb8 initial

Lab conversion 16

Convert back to Adobe RGB / 8

I didn't apply sharpening on purpose to show that the colors are different even without other changes

Turning on and off the levels you can clearly see that the lab level and the level of the re-conversion in adobe rgb8 are identical ... practically in the shadows above all the colors are different

Can anyone tell me why this happens?

Lab sharpness.afphoto

Link to comment
Share on other sites

Hi,

not an expert in this matter.

Never the less, RGB/LAB conversions has multiple paramters to choose, so it seems obvious it must be lossy to some extend, explaining the differences you observe.

Regarding your workflow, i would suggest to make a copy of the layer, then create the selection in the copied document, and copy it back, to avoid quality loss of these conversions.

Maybe it would be sufficient to use a regular RGB luminosity mask without any visible difference, to avoid these color format conversions completely.

 

 

 

 

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

Thanks for the reply

I use lab sharpening because it "seems" to work better in the brightness areas of the image .... it says it looks like from what I could see .... but yesterday I noticed that in the re-conversion to adobe rgb some areas have a color different ... especially in the shadows.

Link to comment
Share on other sites

  • 2 weeks later...

Hi to explain better I am attaching the tests I did .... I do not know why it happens but in the end when I want to apply the unsharp mask Lab the final image has a different color in the shadows.

The first image is an Adobe rgb 1998 RGB / 8 Jpeg, the second is the same converted to lab and the last is the conversion to RGB / 8 ... as you can see the output colors are different.

Does anyone know how to avoid this inconvenience ... otherwise I would have to use a normal unsharp mask without converting the colors to Lab and then converting them back to rgb 8

JPEG ADOBE RGB-8.jpg

JPEG LAB 16.jpg

JPEG ADOBE RGB-8 Ri-conversion.jpg

Link to comment
Share on other sites

Are these actual files or are they screenshots? They all look the same to me, mostly black with patches of grey.

John

Windows 10, Affinity Photo 1.10.5 Designer 1.10.5 and Publisher 1.10.5 (mainly Photo), now ex-Adobe CC

CPU: AMD A6-3670. RAM: 16 GB DDR3 @ 666MHz, Graphics: 2047MB NVIDIA GeForce GT 630

Link to comment
Share on other sites

On 3/29/2021 at 8:35 AM, Tony77 said:

Hello, I was applying the lab method for sharpening to an image, here are the stepsI took

Converting from adobe rgb / 8 to Lab 16

Select brightness channel -> load pixel selection

Invert selection

unsharp mask radius 0.5 factor 1

deselect

reset channels

conversion from Lab16 to adobe rbg / 8

I don't understand the "loading a pixel selection into the brightness channel, and then inverting it".  Are you missing a step where you have first made a selection?

The method I been using for LAB sharpening is just:

Converting from original color format to Lab 16
Use unsharp mask filter
conversion from Lab16 back to original color format

 

Intel i7-10700 Gen10 CPU, 32GB RAM, Geforce GTX 1660 OC 6GB
Windows 10 Pro 22H2, 1x 1TB M.2 NVMe, 1 x 2TB M.2 NVMe. Affinity APh, APu, ADe

Link to comment
Share on other sites

Hello

I redid the test with larger files On the monitor I see that the final file of the reconversion has colors that turn to light blue in the shadows .... this is the problem that I notice if I apply a lab sharpening and then re-convert the colors to 16 or 8 bit RGB

1344237112_RGB16Original.thumb.jpg.770492f2f786c36883dbd111cae3f84b.jpgLab.thumb.jpg.3539b83923fc9cefc5a6c6a830c0028c.jpg1344237112_RGB16Original.thumb.jpg.770492f2f786c36883dbd111cae3f84b.jpg1944597641_Ri-conversionRGB16.thumb.jpg.678feab5ffc9765ae35ad78adf2fe124.jpgLab.thumb.jpg.3539b83923fc9cefc5a6c6a830c0028c.jpg1344237112_RGB16Original.thumb.jpg.770492f2f786c36883dbd111cae3f84b.jpg1944597641_Ri-conversionRGB16.thumb.jpg.678feab5ffc9765ae35ad78adf2fe124.jpgI redid the test with larger files

Link to comment
Share on other sites

20 minutes ago, Greyfox said:

I don't understand the "loading a pixel selection into the brightness channel, and then inverting it".  Are you missing a step where you have first made a selection?

The method I been using for LAB sharpening is just:

Converting from original color format to Lab 16
Use unsharp mask filter
conversion from Lab16 back to original color format

 

Hi .... I saw some videos where they loaded the pixels of the brightness channel and then reversed the level .... honestly I also had some doubts but I have seen more than one :( But now I have seen one that I had never seen and in fact they do not make that passage

Link to comment
Share on other sites

7 minutes ago, Tony77 said:

Hi .... I saw some videos where they loaded the pixels of the brightness channel and then reversed the level .... honestly I also had some doubts but I have seen more than one :( But now I have seen one that I had never seen and in fact they do not make that passage

The video tutorial that I based my LAB sharpening on is by Chris P Williams.  https://www.youtube.com/watch?v=6IjI6eT_VvU

Intel i7-10700 Gen10 CPU, 32GB RAM, Geforce GTX 1660 OC 6GB
Windows 10 Pro 22H2, 1x 1TB M.2 NVMe, 1 x 2TB M.2 NVMe. Affinity APh, APu, ADe

Link to comment
Share on other sites

Again, all I see is dark grey on black. Are there supposed to be colours?

John

Windows 10, Affinity Photo 1.10.5 Designer 1.10.5 and Publisher 1.10.5 (mainly Photo), now ex-Adobe CC

CPU: AMD A6-3670. RAM: 16 GB DDR3 @ 666MHz, Graphics: 2047MB NVIDIA GeForce GT 630

Link to comment
Share on other sites

I downloaded your aphoto file and looked at the three layers in it.  The histogram shows a difference between the original image and the first variation of it - namely that the red channel gets shifted slightly toward the shadow end of the histogram.  The third image (presumably the conversion of the Lab image back to AdobeRGB) is identical in the histogram to the second image, as expected.  Visually, all three images (layers in the document) look identical on my calibrated and profiled EIZO Color Edge display; however, if you boost the shadows significantly, you can see that the upper half of the background gradient is shifting color between the original image and the converted ones.  This may simply be the effect of quantization errors when doing the conversion, even if one converts the 8bit image to a 16bit image before the conversions to Lab.  Here, the errors are occurring in very dark, gradient tones, where there is little information to begin with and the entire upper half of the image background reads somewhere between 0 and 2 in the L channel.  You may want to dither the gradient in the background of your image before the conversion and see if it helps smooth the conversion.

It sounds like the sharpening you are attempting to do is supposed to target shadow tones - that is, you use an inverted L channel as your sharpening mask (and targeting the shadows in the image in your aphoto file makes no sense, as there is nothing to sharpen except noise).  As such, if there are any changes to the image resulting from the operation and the subsequent return back to RGB, they would happen in the darker tones; however, the changes would likely be minimal in real life and, while they appear on the histogram, they are not visible on a display device that can render the file accurately until you crank up the shadows.  In this particular case, you may simply be seeing errors because of the nature of the very dark tones and little separation between them (especially prevalent in your CG render, instead of a photograph) - your display may also be struggling to display the very dark shadows, amplifying the effect.

kirk

 

 

Link to comment
Share on other sites

3 hours ago, kirkt said:

I downloaded your aphoto file and looked at the three layers in it.  The histogram shows a difference between the original image and the first variation of it - namely that the red channel gets shifted slightly toward the shadow end of the histogram.  The third image (presumably the conversion of the Lab image back to AdobeRGB) is identical in the histogram to the second image, as expected.  Visually, all three images (layers in the document) look identical on my calibrated and profiled EIZO Color Edge display; however, if you boost the shadows significantly, you can see that the upper half of the background gradient is shifting color between the original image and the converted ones.  This may simply be the effect of quantization errors when doing the conversion, even if one converts the 8bit image to a 16bit image before the conversions to Lab.  Here, the errors are occurring in very dark, gradient tones, where there is little information to begin with and the entire upper half of the image background reads somewhere between 0 and 2 in the L channel.  You may want to dither the gradient in the background of your image before the conversion and see if it helps smooth the conversion.

It sounds like the sharpening you are attempting to do is supposed to target shadow tones - that is, you use an inverted L channel as your sharpening mask (and targeting the shadows in the image in your aphoto file makes no sense, as there is nothing to sharpen except noise).  As such, if there are any changes to the image resulting from the operation and the subsequent return back to RGB, they would happen in the darker tones; however, the changes would likely be minimal in real life and, while they appear on the histogram, they are not visible on a display device that can render the file accurately until you crank up the shadows.  In this particular case, you may simply be seeing errors because of the nature of the very dark tones and little separation between them (especially prevalent in your CG render, instead of a photograph) - your display may also be struggling to display the very dark shadows, amplifying the effect.

kirk

Hi kirk

yes I understood that it could be something similar to your explanation (among other things very precise and professional)

I apply a lab sharpness by selecting the brightness channel of the lab color space and then I invert the level .... but this last operation leaves me some doubts honestly ... as I saw it on a video tutorial where they apply the sharpness through the lab method.

As suggested by another user above ... also you recommend to select the brightness channel and avoid inverting it ??.

I had never noticed the sharpening mask but in fact it looks like it should be reversed

I attach how the mask looks on my rendering

MasK lab.JPG

Link to comment
Share on other sites

Something that is odd in AP that should not occur when converting your image from an RGB color space to Lab is a noticeable shift in the shadow tones.  The video to which Greyfox links above (https://www.youtube.com/watch?v=6IjI6eT_VvU) also shows this phenomenon and the author of the video incorrectly states that the contrast and color change when converting to Lab because of its larger gamut compared to sRGB - the color should not change at all if the conversion is done properly, that is the whole idea of converting from one color space to another, preservation of color appearance.

As far as sharpening goes, it is not clear when working on a Lab document if sharpening is applied to all three channels, as one would expect, or some variation of them.  Presumably the default method should be sharpening all channels equally, L, a and b.  If you want to sharpen L only and not disturb the color data in a and b, then you can do that too, but my guess is that AP does not simply sharpen L only by default.  In other words, it is unclear what the utility of sharpening in Lab is without further understanding how AP performs the sharpening.  Conversion to Lab prior to sharpening does give you access to L, a and b channels, not only for masking the sharpening, but for choosing to sharpen only the L channel.

EDIT - I just opened an image in Lab in AP.  I used a Live Filter layer USM to add a lot of sharpening.  L, a and b were all sharpened, as expected.  I then made this sharpened result a pixel layer and used Apply Image to apply just its L channel to the original image, to add sharpened L to the original color.  This gives you more control over contrast and color than RGB sharpening, typically, but the type of image and the sharpening you are trying to apply may make the differences obvious or hardly noticeable - maybe the technique is not worth the trouble for some images, whereas for others it may make a huge difference.

As far as using an inverted L mask to modulate the sharpening, if that's where you want to the sharpness to be (shadows and dark midtones) then that is an easy way to do it.  One problem is that, with digital photos, you are targeting the areas of the image where the most noise is hiding with most of your sharpening.  You probably do not want to sharpen noise.

It is troubling though that the image color and contrast shifts noticeably when converting to and from Lab - this should not happen and may, ultimately, explain what you are noticing in your images.

Kirk

Link to comment
Share on other sites

3 hours ago, kirkt said:

Something that is odd in AP that should not occur when converting your image from an RGB color space to Lab is a noticeable shift in the shadow tones.  The video to which Greyfox links above (https://www.youtube.com/watch?v=6IjI6eT_VvU) also shows this phenomenon and the author of the video incorrectly states that the contrast and color change when converting to Lab because of its larger gamut compared to sRGB - the color should not change at all if the conversion is done properly, that is the whole idea of converting from one color space to another, preservation of color appearance.

As far as sharpening goes, it is not clear when working on a Lab document if sharpening is applied to all three channels, as one would expect, or some variation of them.  Presumably the default method should be sharpening all channels equally, L, a and b.  If you want to sharpen L only and not disturb the color data in a and b, then you can do that too, but my guess is that AP does not simply sharpen L only by default.  In other words, it is unclear what the utility of sharpening in Lab is without further understanding how AP performs the sharpening.  Conversion to Lab prior to sharpening does give you access to L, a and b channels, not only for masking the sharpening, but for choosing to sharpen only the L channel.

EDIT - I just opened an image in Lab in AP.  I used a Live Filter layer USM to add a lot of sharpening.  L, a and b were all sharpened, as expected.  I then made this sharpened result a pixel layer and used Apply Image to apply just its L channel to the original image, to add sharpened L to the original color.  This gives you more control over contrast and color than RGB sharpening, typically, but the type of image and the sharpening you are trying to apply may make the differences obvious or hardly noticeable - maybe the technique is not worth the trouble for some images, whereas for others it may make a huge difference.

As far as using an inverted L mask to modulate the sharpening, if that's where you want to the sharpness to be (shadows and dark midtones) then that is an easy way to do it.  One problem is that, with digital photos, you are targeting the areas of the image where the most noise is hiding with most of your sharpening.  You probably do not want to sharpen noise.

It is troubling though that the image color and contrast shifts noticeably when converting to and from Lab - this should not happen and may, ultimately, explain what you are noticing in your images.

Kirk

Thanks Kirk you were very clear I usually prefer to use this LAB method to not have halos around the edges .... but you have a tip on sharpness I gladly accept it.

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.