Chaos Corona Forum

Chaos Corona for 3ds Max => [Max] I need help! => Topic started by: cjwidd on 2019-12-06, 06:58:44

Title: [RESOLVED] 32 bit to 16bit (2019)
Post by: cjwidd on 2019-12-06, 06:58:44
Converting an approximately ~6000 x 8000 pixel image from 32-bit (.EXR) to 16-bit destroys the tonal range of the image. I understand this is a historical problem that has been addressed before (https://forum.corona-renderer.com/index.php?topic=7174.msg51714;topicseen#msg51714), but the previous solutions are not working in this case.

Note that rendering at a lower resolution (~3000 x 4000), saving to 32-bit (.EXR), and converting to 16-bit produces a more consistent result, i.e. converting from full-float to half-float on a lower resolution image reduces the problem.

Is there a workaround for converting 32-bit to 16-bit for high resolution images?
Title: Re: 32 bit to 16bit (2019)
Post by: sprayer on 2019-12-06, 14:53:03
On link it's a bit different issue, did you choose this settings during converting image?
(https://i.imgur.com/Q6Fi8Dt.jpg)
Title: Re: 32 bit to 16bit (2019)
Post by: pokoy on 2019-12-06, 15:29:12
Photoshop does not convert correctly when going from 32bpc to 16bpc - it just doesn't. Unless you really need to work in 32bpc in PS, it's better to save to 16 bits directly from Corona VFB or CIE.
If you really need 32bpc in PS you can use AE. You could flatten your work in PS, save as EXR and open it in AE and output to 16bpc. Make sure to setup profiles in the way you need them, so you convert to the profile you need the final image to be in. AE will work much better, PS does some black magic dark tone shifting and it's awful, there is just no way to make it work correctly in PS.
Title: Re: 32 bit to 16bit (2019)
Post by: cjwidd on 2019-12-06, 21:29:15
@sprayer
Yes, that's correct, I applied the HDR Toning (exposure / gamma) settings as depicted during the conversion. Unfortunately, that did not correct the issue.

I can already tell I'm going to have to submit a support ticket because I don't think I will be able to share the project files to the forum.

What's more, saving out a 16-bit image straight out of the VFB also results in tonal loss.

@pokoy
I'm willing to acknowledge that is true, but nevertheless, I need to find a workaround to bring the image that appears in Photoshop correctly in 32-bit down to 16-bit without tonal loss.

Title: Re: 32 bit to 16bit (2019)
Post by: Juraj on 2019-12-06, 21:44:42
What is tonal loss? You end up with gradient artifacts?
Title: Re: 32 bit to 16bit (2019)
Post by: cjwidd on 2019-12-06, 23:00:27
I've attached a link (https://drive.google.com/open?id=1jT5x1aIWULSIMkWsWif4W3cTgLSI9c3C) to a Google Drive download for a crop of the affected image.

Converting the linked image from 32-bit to 16-bit in Photoshop produces a dramatic change in the overall appearance of the image, most notably in terms of exposure / gamma correction. I cannot account for the discrepancy, but I am posting to the forum for guidance.
Title: Re: 32 bit to 16bit (2019)
Post by: sprayer on 2019-12-07, 17:48:35
Are you sure what you have difference in 100% zoom? Because i do not see difference after converting, only difference if you zoom out, but this i think limitation of photoshop and how it filtering big image
Title: Re: 32 bit to 16bit (2019)
Post by: cjwidd on 2019-12-07, 20:02:55
yeah, I was thinking that might be the case, and Photoshop just can't represent the full pixel range when the image is fit to screen, but then why is the 32-bit image fully represented before converting to 16-bit?
Title: Re: 32 bit to 16bit (2019)
Post by: James Vella on 2019-12-07, 20:07:07
Are you sure what you have difference in 100% zoom? Because i do not see difference after converting, only difference if you zoom out, but this i think limitation of photoshop and how it filtering big image

Agreed.

this is what I see after conversion:
(https://i.ibb.co/t8GdCkB/2.jpg) (https://ibb.co/xJk45Ph)
(https://i.ibb.co/XV7vss8/1.jpg) (https://ibb.co/d7Pz22g)
Title: Re: 32 bit to 16bit (2019)
Post by: romullus on 2019-12-07, 20:15:05
yeah, I was thinking that might be the case, and Photoshop just can't represent the full pixel range when the image is fit to screen, but then why is the 32-bit image fully represented before converting to 16-bit?

When image is displayed at any other zoom level than 1:1, then pixels needs to be interpolated. I guess that photoshop uses different interpolation for 16 bit and 32 bit images. When comparing two images, you always need to do that at 1:1 zoom level, otherwise you can't know what are you comparing.
Title: Re: 32 bit to 16bit (2019)
Post by: cjwidd on 2019-12-07, 20:21:06
..then pixels needs to be interpolated.

Yes, this is exactly what I was thinking.

Well, that is an embarrassing oversight, but thank you all for clarifying 😬

I am not sure what the approach is then for photoediting, if there is so much of a difference between the 32-bit and 16-bit version when fit to screen?

(https://i.imgur.com/OKl2lzQ.png)
Title: Re: 32 bit to 16bit (2019)
Post by: James Vella on 2019-12-07, 21:22:35
Yes mine looks like this when fit to screen
Title: Re: 32 bit to 16bit (2019)
Post by: cjwidd on 2019-12-07, 22:21:45
I suppose we are outside the purview of Corona at this point - seems like a Photoshop issue.
Title: Re: 32 bit to 16bit (2019)
Post by: cjwidd on 2019-12-08, 00:22:06
Would the compression (interpolation) issue appear on a high DPI monitor when fit to screen in Photoshop?
Title: Re: 32 bit to 16bit (2019)
Post by: romullus on 2019-12-08, 11:02:58
If the image won't fit on screen in 1:1 zoom level, then pixels will have to be interpolated no matter display resolution.
Title: Re: 32 bit to 16bit (2019)
Post by: cjwidd on 2019-12-08, 11:49:14
How does Corona VFB address this issue?
Title: Re: 32 bit to 16bit (2019)
Post by: romullus on 2019-12-08, 12:23:43
It doesn't need to. First of all, it always displays same bit depth image and it only allows to zoom in discrete steps 2:1, 1:1, 1:2 For that, simplest and most primitive interpolation method of nearest neighbours, is enough.
Title: Re: 32 bit to 16bit (2019)
Post by: sebastian___ on 2019-12-08, 12:28:30
I'm not sure if the issue will still be present, but when you use certain zoom values in Photoshop, the image is not aliased anymore. When I want a clear picture I use the ALT CTRL  and plus minus from numpad for zoom, and not the mouse wheel.

100%, 50%, 25% would behave more like a 1:1 scaling. And maybe also 75%, 66.67%, 33.33%. These values will be automatically used if you use those keyboard shortcuts.
Title: Re: [RESOLVED] 32 bit to 16bit (2019)
Post by: patrick.testa on 2019-12-12, 19:11:16
Maybe I'm making a useless comment but I'd like to share my workflow for 32bit images in Photoshop. It works very well for me:
1 I save .exr images with all the extra channels I may need (reflect refract, etc.)
2 I compose them in Photoshop in 32bit mode adding reflections where I want and other general corrections
3 I group all layers and make the group a smart object
4 I convert to 16bit and when Photoshop asks if I want to flatten the image I say no; in that way the colors are preserved (at least to my eyes...)
5 I make further corrections using Camera raw and other filters that will always be editable since they are applied to the smart object
6 If I need it, I can always open the smart object and make further adjustments to the 32 bit layers and when I close it the 16 bit image will be updated
7 I save a final Jpg

I hope it can helpful to anyone!

Best,

Patrick
Title: Re: [RESOLVED] 32 bit to 16bit (2019)
Post by: Juraj on 2019-12-13, 13:19:28
Maybe I'm making a useless comment but I'd like to share my workflow for 32bit images in Photoshop. It works very well for me:
1 I save .exr images with all the extra channels I may need (reflect refract, etc.)
2 I compose them in Photoshop in 32bit mode adding reflections where I want and other general corrections
3 I group all layers and make the group a smart object
4 I convert to 16bit and when Photoshop asks if I want to flatten the image I say no; in that way the colors are preserved (at least to my eyes...)
5 I make further corrections using Camera raw and other filters that will always be editable since they are applied to the smart object
6 If I need it, I can always open the smart object and make further adjustments to the 32 bit layers and when I close it the 16 bit image will be updated
7 I save a final Jpg


This is common and smart workflow, but I will comment on this because I've seen one big misconception people have about this concept:

-Photoshop doesn't work in bit-depth of the smart layer, but only the actual environment. So there so no dynamic range available with adjustment applied to this smart layer within 16bit mode, the dynamic range is only available within the smart layer environment (if that is retained as 32bit).
-CameraRaw adjustments like Highlight compression,etc.. are thus working the same way as if you applied them to jpeg (because both 8&16bit PS environment are clipped integer gamma-corrected environments).
Title: Re: 32 bit to 16bit (2019)
Post by: Juraj on 2019-12-13, 13:20:43
Would the compression (interpolation) issue appear on a high DPI monitor when fit to screen in Photoshop?

The higher is the DPI the lesser the issue is, high resolution lessens the effects of aliasing. Work only in 25/33.33/50/66.66/75/100/etc.. zoom increments.
Title: Re: [RESOLVED] 32 bit to 16bit (2019)
Post by: patrick.testa on 2019-12-16, 10:09:24
Maybe I'm making a useless comment but I'd like to share my workflow for 32bit images in Photoshop. It works very well for me:
1 I save .exr images with all the extra channels I may need (reflect refract, etc.)
2 I compose them in Photoshop in 32bit mode adding reflections where I want and other general corrections
3 I group all layers and make the group a smart object
4 I convert to 16bit and when Photoshop asks if I want to flatten the image I say no; in that way the colors are preserved (at least to my eyes...)
5 I make further corrections using Camera raw and other filters that will always be editable since they are applied to the smart object
6 If I need it, I can always open the smart object and make further adjustments to the 32 bit layers and when I close it the 16 bit image will be updated
7 I save a final Jpg


This is common and smart workflow, but I will comment on this because I've seen one big misconception people have about this concept:

-Photoshop doesn't work in bit-depth of the smart layer, but only the actual environment. So there so no dynamic range available with adjustment applied to this smart layer within 16bit mode, the dynamic range is only available within the smart layer environment (if that is retained as 32bit).
-CameraRaw adjustments like Highlight compression,etc.. are thus working the same way as if you applied them to jpeg (because both 8&16bit PS environment are clipped integer gamma-corrected environments).

You're absolutely right! Dynamic range adjustments need to be made exclusively in the 32bit environment. What I do in 16 bit are only final adjustments that are more difficult or imposible to do in 32 bit mode, like white point compensation, that camera raw handles well and easily or a little bit of smart sharpen in certain areas of the image... Also, I think that working in camera raw in 16bit works much better than in 8bit because of the higher color depth; it's like working on .dng images from cameras instead of jpgs...
Title: Re: [RESOLVED] 32 bit to 16bit (2019)
Post by: maru on 2019-12-16, 18:01:19
Here we are, over 10 years later:
https://clearps.com/photoshop-discussions/threads/74156-why-is-quot-zoomed-out-quot-image-low-quality/
Quote
HOW ABOUT GIVING THE USERS A TOGGLE BETWEEN "SMOOTH AND ACCURATE" AND "CRAPPY AND INACCURATE (DEFAULT)"
Title: Re: [RESOLVED] 32 bit to 16bit (2019)
Post by: cjwidd on 2019-12-21, 02:49:15
lmao^

Man, that post is **actually** from 2008. Respect.
Title: Re: [RESOLVED] 32 bit to 16bit (2019)
Post by: cjwidd on 2020-02-13, 07:22:11
I've created a short video describing the issue I was facing in the original post because I have not arrived at a satisfactory solution - I have taken the notes / advice posted in this thread in mind.

video (https://youtu.be/Z1nFpYI4vwY) (watch x1.5 speed)
Title: Re: [RESOLVED] 32 bit to 16bit (2019)
Post by: romullus on 2020-02-13, 10:04:02
I think you've already been told, you need to view your images at certain zoom levels - 400%, 200%, 100%, 50%, 25%, etc. By viewing the image at arbitrary zoom level, you're getting unpredictable "untrue" result.
Title: Re: [RESOLVED] 32 bit to 16bit (2019)
Post by: cjwidd on 2020-02-13, 10:50:29
That's right, although that suggestion does not resolve the issue; a comparison of the discretized zoom levels is not illustrated in the video.