[NOOBTUT#1] Introduction to 32-bit color depth

Created a nice video, document or a translation of another document? Share it here for licensed users.
User avatar
JQL
Thea Beta Tester
Thea Beta Tester
Posts: 5311
Joined: Sun Jun 23, 2013 6:34 pm
Location: Lisboa
Has thanked: 22 times
Been thanked: 118 times
Contact:

Hi guys,

This is the first of a series of posts I intend to make called [NOOBTUT]'s.

The theme of this one has to do with the final part of our render work.

Like any other noob, I want to start by the finished render and forget about all the rest of the process.

So, today I'll bring you a set of posts dedicated to EXR files, 32-bit and 8-bit color depths, 32-bit basic tonemapping and a very basic introduction to node base post processing or mage compositing.


NOOBTUT Disclaimer:

I'm pretty sure this [NOOBTUT] has errors, but the empiric knowledge it contains makes sense to me, and as helped me achieve my goals, so I'm sharing it!

EXR Tutorial All 8-bit Outputs.jpg
Introduction:

I'm posting this topic as I've noticed many people that are taking the first steps on rendering (myself included), aren't aware of the benefits they can get from saving an image in a format that supports 32-bit color depths like EXR (or HDR), and then extract from it everything you need.

Instead of using 32-bit what most of us do when we start with rendering, is jumping directly to the popular 8-bit formats widespread everywhere - JPG and PNG!

For the sake of Thea quality, we are going to focus specially in 32-bit images wich are an ideal resource for tone mapping and for use in post production since Thea as made a lot of channels for Presto (also called render passes). The idea behind that is that with simple adjustments available in most editors, like Levels or Curves, you can enhance details on areas of an image, where you think there are none. This are typically full bright areas or very dark areas. You can also enhance colors in the mid range areas (the areas where colors are increasingly distinguisheable to the human eye).

For this tonemapping and post production to be available in 32-bit the most important thing that you have to get is software that is able to support EXR and 32-bit depth images. This might spook some of you as it narrows down your choices a lot, but don't worry about that! 32-bit editing is an excellent filter for selecting quality software and that doesn't necessarily mean expensive software. It can actually mean free software!


So First things first: What are the differences between 8-bit and 32 bit color depths?

8-bit means that an image has 16.777.215 colors. This large number of colors allows the image to be perceived as very close to real. The most common 8-bit depth file formats are JPG and PNG and almost every software that deals with images will read those. Though PNG is less widespread it has advantages over JPG and nowadays it's almost as common as JPG.

The main difference from JPG to PNG, is that the latter adds to these colors an alpha channel wich is able to produce transparent pixels. This alpha channel doesn't eliminate the colors of the base image, it just introduces transparency that can range from 0% to 100% transparent pixels. In a 100% transparent pixel the color is there but you can't see it. This is the main reason that usually makes PNG files heavier than JPG files, but there are other reasons wich are also related with image quality and one of them, like mentioned before, is that a PNG is capable of 16-bit color depth. The colors used in images are typically RGB, when you get an alpha value (transparency value) You are dealing with RGBa.

We are going to focus mainly on 32-bit or rather on 8-bit and 32-bit.

32-bit will be your working color depth, but you will never be able to see all it's colors at once so most of the times you can only see 8-bit at a time even if you are working with a 32-bit image. You can raise this if you have high depth color screens but we will neglect that for now.

So, even if this post is about using higher color depth images, you'll still have to know that your final image will be an 8-bit color depth image. You will need this if you want to share it, display it online, use it in most CAD software, print it, etc...

Therefore, this process is about introducing a new step in your workflow wich will be based in your 32-bit image and the work you can do with it towards your final 8-bit output.


Thea render color Depth

8-bit depths are enough for the human eye to be convinced of the realism of an image, however every render you produce in Thea has 32-bit color depth.

This means that Thea is calculating colors within a range as high as 4.294.967.296 colors and this is 256 times more colors than JPG or PNG can handle...

I always get lost when numbers get past the four digits threshold so, as both numbers are very high let's make an easy digit comparison:
0.016.777.215
4.294.967.296

As you can see, if you save an image directly from Thea darkroom as jpg or png, you're potentially wasting:
4.278.190.081 colors


This is mind blowing and, from a strict economicist/ecological point of view, it's a complete waste!


Why is Thea calculating so many colors if I only need 256 times less colors?

This question makes sense, right?

If it would calculate less colors it would render faster! Hurray! Presto X!

Well of course I don't think that way and neither should you...

The reason Thea is calculating much more than what your monitor sees and, is that Thea is giving all this to you so you can see it too, if you wish, and then choose what to show to others. So Thea is letting you, punny human, decide!

Having 32-bit color depth, means that inside a Thea render you have information of subtleties both of the brightest part of the image, like the sun, as well as the darkest corner of the image like a crack in a shadowed out pavement, and other places where almost no light can reach. Besides that you can also have more precise information on the mid color range, wich is where most of the action happens.

These subtleties exist only because of the 32-bit color depth a Thea render produces and, if we are wreckless as noobs that we are, might get lost in the 8-bit images we quickly export. The thing is that a lot of that color info will have to eventually get lost. What you should be able to do though, is carefully select what you can and cannot loose.

The smaller 8-bit color depth has much less colors than reality and the typical place they get lost is within dark and bright areas. These areas might easily turn into flat black or flat white areas in a JPG... but they will have a lot of info in an EXR.

That is why, when you have an high contrast image, like a poorly lighten interior with a lot of light outside, you usually must opt to see the interior details, leaving the exterior fully white, or the reverse, where you get details on the exterior and a very dark interior. This is exactly what happens to cameras too so, most of the time these images work very well and we don't care about wasted colors.



So, if I have all those 32-bit depth colors in my render, why can't I see all of them at the same time?

That really is the main issue here, for even if the details are all there, a monitor or pc screen can't show them as it also works with much less color depth than 32-bit. Most of them can only show 8-bit depth images.

This is also what happens with a camera. You have reality with all that info, but you can only show what the camera is able to capture!

So, you simply cannot have so many colors as 32-bit in the regular mediums you use like PC screens, printed output, movies, television, etc...



EXERCISE 1:

The image at the start of the post, was generated from one EXR with 32-Bit Color depth. Each of the four parts of the image is an 8-bit color version of the EXR, focused on a certain brightness range from it. The original render was displayed exactly as the image in the left, further to the right a very dark output, then an output focused on the midrange colors, wich looks more like we see things, and the brigther range of the EXR is at the right.

For extracting all these 4 8-bit outputs from the same EXR I simply meddled with a Levels Filter, then those images were put together and combined into the single 8-bit image you see.

If you download the image and apply a levels filter (you can use Photoshop, Gimp, Krita, or most of the image editors available), you will never be able to get any of the four sections of the image to match any other.

TRY IT:

EXR Tutorial Krita Levels.jpg
0 - Open the image in your image editor of choice;
1 - Use rectangle select to select one of the 4 sections of the image;
2 - Find the filters, adjustments or colors menu and try finding something that reads "Levels" or "brightness levels".
3 - Adjust the top gradiented line and the bottom gradiented line until you find a matching brightness.

CONCLUSION:

What happens is that the image will start loosing details as you are pushing it to get whiter or darker levels. The more extreme the tone mapping the worse it gets.
EXR Tutorial Krita Levels Result.jpg
What also happens, is that the easier images to match are the rendered output, and the midtone outputs.

You won't be able to match saturation as there's a lot of color degradation and you will start having harsher tone transitions in the midrange. Even if you could compensate from color saturation, you'd never be able to compensate for the pixel information that's being lost with those harsher transitions. Artifacts like these will easily pop out.

Also, if you look at the darker image, you can get more information (even if completely ruined) than from the brigther one. This is the reason the original render output is darker.

NOTE: When tonemapping darker images sometimes you may need to compensate with increasing saturation.


So guys, this is what happens with 8-bit tone mapping. Next time we'll work with a 32-bit color image so you can push it to the limit and it will not loose pixel details.

That is what all the colors from 32-bit allow you and that 8-bit simply can't match.

Next [NOOBTUT]:

Next time we'll talk about what we can do with an EXR, wich are the main aproaches towards Tonemapping a final image, wich software can we use to do it, go a bit more in depth into the basic tone mapping filters, like Levels or Curves.

Finally We'll also adress how to aproach tonemapping (and post processing overall) in an undestructive way.

So basically we'll get our hands on the job!

Say your mind:

I hope this introduction, wich was mainly informative rather than practical, somehow captivated you for the next part.

Feel free to use the reply section to add info or criticize the info here and help me learn myself. I will correct whatever I can in my first post.

Best regards and see you soon!
www.casca.pt
Visit us on facebook!

Win 10 64bit
Sketchup 2017 64bit
Intel i7 5820K 3.3Ghz 32Gb Ram
Nvidia Titan X 12Gb
User avatar
Bob James
Licensed User v1.5
Licensed User v1.5
Posts: 1482
Joined: Sat Nov 21, 2009 6:57 am
Location: Lompoc, CA USA
Has thanked: 4 times
Been thanked: 2 times

Bravo :thumbup:
Bring it on :clap:
i7-6800K 3.4Ghz, GTX 1080ti 11GB, 32GB Crucial DDR4-2400 ECC, OCZ Vertex 4 1TB, WD Black 3TB, 32TB NAS, 4x Dell 27" Monitors, SpaceMouse Pro
Never underestimate the intelligence of your audience nor overestimate your own - Bob James
User avatar
JQL
Thea Beta Tester
Thea Beta Tester
Posts: 5311
Joined: Sun Jun 23, 2013 6:34 pm
Location: Lisboa
Has thanked: 22 times
Been thanked: 118 times
Contact:

Thanks Bob,

I'm just preparing images and finetunning the second and third on this EXR/32-bit series.
www.casca.pt
Visit us on facebook!

Win 10 64bit
Sketchup 2017 64bit
Intel i7 5820K 3.3Ghz 32Gb Ram
Nvidia Titan X 12Gb
User avatar
gwengosch
Licensed User v1.5
Licensed User v1.5
Posts: 907
Joined: Sun Jun 09, 2013 6:44 pm
Location: france
Has thanked: 6 times
Been thanked: 12 times

Stick this!!!

This is a very good tutorial.

Thanks a lot.
Gwenael Gosch
La fabrique à plans
http://www.lafabriqueaplans.fr
Facebook
User avatar
JQL
Thea Beta Tester
Thea Beta Tester
Posts: 5311
Joined: Sun Jun 23, 2013 6:34 pm
Location: Lisboa
Has thanked: 22 times
Been thanked: 118 times
Contact:

Thanks Gwengosh! I hope this helped you...
www.casca.pt
Visit us on facebook!

Win 10 64bit
Sketchup 2017 64bit
Intel i7 5820K 3.3Ghz 32Gb Ram
Nvidia Titan X 12Gb
DavePSB
Licensed User v1.5
Licensed User v1.5
Posts: 1291
Joined: Wed May 12, 2010 8:56 pm
Location: France
Has thanked: 13 times
Been thanked: 16 times

Nice job. I have learned a lot from your two NOOBTUTs.

Conceptual question about software:

I have used Photo Shop's "Camera Raw" sub program to fiddle with RAW images from my DSLR. I have achieved some great results (like lightening the interior of a room without blowing out the exterior through windows). There are many sliders, but some good basic ones like whites, blacks, highlights, shadows, exposure, contrast, etc. I haven't tried Camera Raw with .EXR, but I suspect it will work.

EDIT
Nope, PhotoShop (Elements) and Camera Raw don't open .EXR files, so this answers one question - still would like to find an EXR editor that has sliders for shadows, highlight, whites, blacks, exposure, contrast, etc. Or am I confusing DSLR RAW editing with EXR/HDR editing?
END EDIT

With Luminance HDR, none of the presets seem to involve "straight forward" sliders like "shadows" and "highlights". Rather, the sliders seem to represent parameters to equations probably presented in various researchers' papers on the subject. Further, the Adjust Levels dialog seem to be pretty basic.

I don't want to turn this into a Luminance HDR thread, but just curious if you find one of the presets in particular that is easier to tweak or that yields consistently good results. So far, I have not had much luck with Luminance when aiming for human eye/mind results, although it is good at producing a wide range of other interesting effects.

EDIT
Actually, using your .EXR example file in Luminance is amazing !! The presets are REALLY good. There is obviously a difference between what goes on inside a .EXR and a .RAW (dslr) file. I'd still like to know why Luminance doesn't handle raw dslr images very well, but for now, WOW!. You've really opened up my eyes to Luminance.
END EDIT


On the other hand, since Photo Shop's Camera Raw is working for me, are there any advantages to trying to figure out Luminance or Picturenaut? I'm happy to put in the time if they have superior (if not hidden) advantages over Camera Raw.

EDIT
Above paragraph is irrelevant since Camera Raw does not work with .EXR afterall
END EDIT


Looking forward to any other tutorials you have in the works. They are really well written and clear.

Thanks,
Dave
Win 10
i7-9700K,3.6GHz,32Gb,
RTX2060Super, 8Gb, 442.19
SUMake2015 (15.3.331)
TheaForSU (1.5.09.547.1462)
Thea Studio (1.5.09.1462)
SUMake 2017 (17.2.2555)
TheaForSU (2.2.954.1860)
Blender 2.79, Plugin 1.5.8.760.1455
Blender 2.8x
Revised 14 Feb 2020
User avatar
JQL
Thea Beta Tester
Thea Beta Tester
Posts: 5311
Joined: Sun Jun 23, 2013 6:34 pm
Location: Lisboa
Has thanked: 22 times
Been thanked: 118 times
Contact:

Dave,

Thanks for your interest and interesting questions.

I cannot give you a straight answer on this subject though as I don't use photoshop for a long time.

Initially the reason is that I found Gimp and got used to it for the kind of image editing I did at the time. Recently Thea took over and I almost get no image editing nor even for photomatching.

Now that 32-bit became standard, all the post production, texture editing, cloning and stamping stuff I do has changed from Gimp to Krita wich deals with 32-bit and adds a lot of functionallity that Gimp lacks and you also get on Photoshop.

I only use Luminance as a quick way of outputing my images. For ultimate control I'm ditching Krita and I'm starting to use Natron and Fusion wich offer impressive workflows and effects. I'm going to overview this kind of adjustments in Natron on [Noobtut#3].

Luminance HDR, unfortunatelly has those presets that have to do with the technical intrincacies of HDR photography. I'm not much into that, just like yourself, but I really like the way I can press the thumbnail previews and simply search for the better aproach.

I'm finding the best results to something like I want to be around Mantiuk 08 as it is between the human eye and camera. But to better get what you want I'd look at Mantiuk 06. In this case, the preset isn't the best aproach but after finetunning it you should be on your way... You can save your settings as presets too you know? (A small disk under tonemapping settings)

About Mantiuk 06 preset:

It really pops up all textures in the image wich, sincerely for me it's too much... (it could be interesting for presentation purposes though). However if you increase the following values you should get what you want and then get the brightness you need, using levels:
LuminanceHDR.JPG
- Increase "Contrast Factor" to get less contrast and less textures poping up;
- Fine tune your global result by increasing "Detail Factor" by very small values of 1 and then 0.5 and then less;
- You can turn on "Contrast Equalization", for bigger images where you can find a difference;
- Of course you can also pop up "Saturation Factor" (I like to keep it low and as it comes out of Thea)

Finally you can adjust Levels but you'll loose that adjustment if you Tonemap your image again.

Final output difference without level adjustment. Tonemap settings described on file name (Luminance saves settings under the LDR files name when you click "Save All"):
EXR Tutorial Base_pregamma_1_mantiuk06_contrast_mapping_0.1_saturation_factor_0.8_detail_factor_1.jpg
EXR Tutorial Base_pregamma_1_mantiuk06_contrast_mapping_0.1_saturation_factor_0.8_detail_factor_1.jpg (305.68 KiB) Viewed 470 times
EXR Tutorial Base_pregamma_1_mantiuk06_contrast_equalization_0.4_saturation_factor_0.8_detail_factor_3.jpg
EXR Tutorial Base_pregamma_1_mantiuk06_contrast_equalization_0.4_saturation_factor_0.8_detail_factor_3.jpg (276.76 KiB) Viewed 470 times
TRICK: If you're unsure which of two Tonemaps you prefer, you can blend them in Photoshop using overlay or other mode and some masks...
www.casca.pt
Visit us on facebook!

Win 10 64bit
Sketchup 2017 64bit
Intel i7 5820K 3.3Ghz 32Gb Ram
Nvidia Titan X 12Gb
DavePSB
Licensed User v1.5
Licensed User v1.5
Posts: 1291
Joined: Wed May 12, 2010 8:56 pm
Location: France
Has thanked: 13 times
Been thanked: 16 times

Very kind of you to take the time to reply in such detail. I will continue to experiment - and especially am interested in your last tip about blending two presets in Photoshop. Will check out Krita and Fusion while we await NOOBTUT#3 re Natron.
Win 10
i7-9700K,3.6GHz,32Gb,
RTX2060Super, 8Gb, 442.19
SUMake2015 (15.3.331)
TheaForSU (1.5.09.547.1462)
Thea Studio (1.5.09.1462)
SUMake 2017 (17.2.2555)
TheaForSU (2.2.954.1860)
Blender 2.79, Plugin 1.5.8.760.1455
Blender 2.8x
Revised 14 Feb 2020
User avatar
JQL
Thea Beta Tester
Thea Beta Tester
Posts: 5311
Joined: Sun Jun 23, 2013 6:34 pm
Location: Lisboa
Has thanked: 22 times
Been thanked: 118 times
Contact:

DavePSB wrote:Will check out Krita and Fusion while we await NOOBTUT#3 re Natron.
That's in the forge. Got some time in my hands as the kids are with their grandparents!

I've noticed Krita getting an yellowish tone on the whites when I tonemapped the sample EXR... That didn't happen in the either of the other but I still didn't post the bug at krita's forums.
www.casca.pt
Visit us on facebook!

Win 10 64bit
Sketchup 2017 64bit
Intel i7 5820K 3.3Ghz 32Gb Ram
Nvidia Titan X 12Gb
User avatar
Robert
Licensed User v1.5
Licensed User v1.5
Posts: 263
Joined: Sat May 08, 2010 8:21 pm
Location: Michigan
Has thanked: 14 times
Been thanked: 15 times
Contact:

Great stuff...thanks for posting! Looking forward to Tutorial #3.

Robert
Robert Scott
Robert Scott Residential Design
https://www.facebook.com/scottresidentialdesign
http://www.flickr.com/photos/scottresid ... sign/sets/
www.scottVIZ.com

"Growing older but not growing up"
Post Reply

Return to “Tutorials & Translations”