batch convert sRGB to linear

   10530   13   2
User Avatar
Member
193 posts
Joined: 4月 2009
Offline
Hi everyone,
I was wondering if there is some tool available to de-sRGB texture files and preferable one that batches through an entire folder.
What do you use to linearize your texture files for a linear workflow?

Does Iconvert have the option to linearize?
Can Iconvert batch convert entire folders?
Because .rat files are prefered i guess a tool that takes all image files from a folder and saves them as linear rat files would be optimal.
Edited by - 2012年3月6日 13:42:48
User Avatar
Member
7046 posts
Joined: 7月 2005
Offline
IMO it's a lot better to have an sRGB to Linear VOP node since your workflow is likely to want to spit out an sRGB texture from Photoshop/3D Coat/whatever, having to convert that each time you save is painful. The speed hit from the sRGB to Lin is so negligible that the speedup in workflow is worth it.


If only SESI would provide an sRGB to Linear VOP node and incorporate it into their standard shaders.

Cheers,

Peter B
Cheers,

Peter Bowmar
____________
Houdini 20.5.262 Win 10 Py 3.11
User Avatar
Member
7871 posts
Joined: 7月 2005
Online
pbowmar
IMO it's a lot better to have an sRGB to Linear VOP node since your workflow

Wouldn't that cause incorrect mipmapping in sRGB space instead of linear?
User Avatar
Member
7046 posts
Joined: 7月 2005
Offline
Well, we've used it for a few years now and haven't noticed
Cheers,

Peter Bowmar
____________
Houdini 20.5.262 Win 10 Py 3.11
User Avatar
Member
4271 posts
Joined: 7月 2005
Offline
edward
pbowmar
IMO it's a lot better to have an sRGB to Linear VOP node since your workflow

Wouldn't that cause incorrect mipmapping in sRGB space instead of linear?

We ran a battery of tests on this a year or so ago. And for some texture maps with a lot contrast it made a bit of difference in terms of luminance at the lower mip map levels, but in a lot of cases the difference isn't that noticeable.

So is it incorrect? Yulp. Is a huge issue, not really. As long as a couple of people know what's going on its not that bad.
if(coffees<2,round(float),float)
User Avatar
Member
193 posts
Joined: 4月 2009
Offline
So if i understand well, you don't convert your textures outside Houdini, you just edit every single shader you use textures in to “pow with 2.2”?

If that would be “standard” workflow, why isn't there a toggle on the mantrasurface shader to do this so we don't have to manually edit each shader?
User Avatar
Member
8 posts
Joined:
Offline
I found you can use ImageMagick to convert:

convert test.tif -set colorspace sRGB -depth 16 -colorspace RGB teste_lin.tiff

I'm trying to figure out how to write a bash script to convert all the files in a folder to linear and then to rat but it's not as easy as I would hope ops:
User Avatar
Member
7046 posts
Joined: 7月 2005
Offline
RudiNieuwenhuis
So if i understand well, you don't convert your textures outside Houdini, you just edit every single shader you use textures in to “pow with 2.2”?

If that would be “standard” workflow, why isn't there a toggle on the mantrasurface shader to do this so we don't have to manually edit each shader?
Actually we use the “proper”sRGB math, though pow 1/2.2 is close enough for a lot of things.

As to “why” you'll have to ask SESI, quite a few of us at pro studios have been asking for years… But of course we have built our own VOP nodes in the meantime to take care of it.

Cheers,

Peter B
Cheers,

Peter Bowmar
____________
Houdini 20.5.262 Win 10 Py 3.11
User Avatar
Member
8 posts
Joined:
Offline
IMO it's a lot better to have an sRGB to Linear VOP node since your workflow is likely to want to spit out an sRGB texture from Photoshop/3D Coat/whatever, having to convert that each time you save is painful.

So you don't use .rat files ?
User Avatar
Member
7046 posts
Joined: 7月 2005
Offline
We do but we put them in sRGB space.

Our workflow is basically:

Photoshop/3D Coat/Mudbox saved as TGA or EXR, load into Houdini and re-render (no conversion to RAT) for fast artist workflow.

Once the texture is published, we convert it to RAT as part of the publish (automated) and we have a simple script that finds all textures in a .hip file and checks if published ones exist. If they do, it switches out the work file for the published file.

Bob's Your Uncle!

Cheers,
Peter B
Cheers,

Peter Bowmar
____________
Houdini 20.5.262 Win 10 Py 3.11
User Avatar
Member
7871 posts
Joined: 7月 2005
Online
Wolfwood
edward
Wouldn't that cause incorrect mipmapping in sRGB space instead of linear?

So is it incorrect? Yulp. Is a huge issue, not really. As long as a couple of people know what's going on its not that bad.

I guess I'm just spoiled by the dramatic examples that have been posted on the web. eg.

Mipmapping incorrectly in sRGB space [filmicgames.com]
Mipmapping correctly in Linear space [filmicgames.com]
(source [filmicgames.com])

(Aside: We once had a bug logged where someone loaded an sRGB image into COPs, scaled it with a Transform COP, and then complained that it was doing it wrong because some web page [4p8.com] told them so. )
User Avatar
Member
12645 posts
Joined: 7月 2005
Online
I'll bet that the typical scene rendered with incorrect mipmapping is hardly ever diagnosed correctly. There are so few shots which last long enough and involve objects slowly moving over significant distances that the mipmap luma shift under sRGB gets compensated for in the lighting process by tweaking intensities.

Even though the impact is quite small, we should always endeavour to have a technically correct pipeline with such things, and things will just seem to improve.

That said, I am still a fan of making RATs, their conversion and their access methods aware of colorspace, and even though I don't have to worry much about this due to a strict, regulated texture pipeline, I think you'll see about 10 posts on this topic my name on them trying to get this topic a little more entry-level friendly

A “Best Practices” help page might be useful too.
Jason Iversen, Technology Supervisor & FX Pipeline/R+D Lead @ Weta FX
also, http://www.odforce.net [www.odforce.net]
User Avatar
Member
7871 posts
Joined: 7月 2005
Online
jason_iversen
IThere are so few shots which last long enough and involve objects slowly moving over significant distances that the mipmap luma shift under sRGB gets compensated for in the lighting process by tweaking intensities.

<tongue-in-cheek>Might as well not bother with the linear conversion and just light it all by tweaking intensities.
User Avatar
Member
7046 posts
Joined: 7月 2005
Offline
I'll raise you tongue-in-cheek with “happens a lot”
Cheers,

Peter Bowmar
____________
Houdini 20.5.262 Win 10 Py 3.11
  • Quick Links