HDRI, external executables, and Daz Script - IF?/HOW?

Here's the PROBLEM:

I need to be able to read HDR / EXR images and extract thumbnail images from them, passing those to Pixmap objects to be placed in widgets for display.

Daz Studio natively does something like this for the Environment slider in the Render Settings pane... choose an HDR and it puts a thumbnail on the slider. However, this seems to be buried in binary, as there is no readable script I can find for the Render Settings panel (unlike other tabs and panes) to see how it's done. I've torn my hair out poring over the Scripting docs but there doesn't seem to be any way to handle HDRI. Neither the Image class nor the QImage it derives from handles HDR/EXR formats natively (pass an HDR to a new Image() and query Image.format, it returns ZERO, Format_Invalid lol), so I suppose it would be necessary to call a routine from a DLL if one is available.

Where such a routine exists in Daz, seems to be either a mystery or a Well Guarded Secret™ (I'm not having success finding such info in SDK docs either).

The QUESTION is:

Is this possible to do this from Script; if not, is it possible to write a plugin to call from Script; OR failing that, is there a simple way to call an executable with a command line from Script? The bottom line is, I can very easily do what I want to do using ImageMagick (and it would likely be much faster in function!), but I'm not exactly sure how to do that from Daz Script. Ultimately I would prefer to stay within Daz's own ecosystem and not rely on an external library.

Any thoughts are most welcome, thanks in advance.

Comments

  • HAH Yes in fact it does, and thanks for your reply!.

    After I posted, I had a strong jug of coffee, and in a caffeine-fueled whirl I uncovered a number of things, including that. I guess I just needed a brain-reset.

    I came across another post here from like 6 years ago, which pointed me to https://sites.google.com/site/mcasualsdazscripts2/mcjlabelizer ... which is using the exact mechanism I wish to employ (assuming I'll use ImageMagick).

    On another note, while scouring the \DAZStudio4\ installation, I discovered \bin\hdri2tif.exe . When tickled with -h at the command line, it says

    C:\Program Files\DAZ 3D\DAZStudio4\bin>hdri2tif -h
    Usage:  hdri2tif [options] <inputfile> <output tiff>
    Options:
      -key n       : set middle-gray value (default is 0.18, range: [0,1], 0=auto)
      -gamma n     : gamma correction value (default is 1)
      -verbose     : run in verbose mode
      -v           : print version number
      -h           : display this help
    
    ``dodging-and-burning'' options:
      -nscales n   : number of scales to use in computation (default is 8)
      -lowscale n  : size in pixels of smallest scale (default is 1)
      -highscale n : size in pixels of largest scale (default is 43)
      -threshold n : scale selection threshold (default is 0.05)
      -sharpness n : set sharpness parameter (default is 8)
      -nthreads n  : number of threads to use (default is # of CPUs)
    
    ``simple'' algorithm options:
      -simple      : enable the use of faster, but simpler, algorithm
      -white n     : set white point (default is maximum luminance in image)
    
    Output TIFF compression options:
      -lzw         : use Lempel-Ziv-Welch compression (default)
      -deflate     : use Adobe's Deflate algorithm
      -packbits    : use Apple's packbits (rle)
      -c-          : disable compression
    
    Please refer to 3Delight's manual for more informations.

    Then there's cmgen.exe:

    cmgen is a command-line tool for generating SH and mipmap levels from an env map.
    Cubemaps and equirectangular formats are both supported, automatically detected
    according to the aspect ratio of the source image.

    It does some very interesting things with HDR input as well. One of these is probably what handles making the Environment slider's thumbnail.

    dsm2tif.exe appears to process Digital Surface Modeling images (?!), and tdlmake.exe converts several image formats to 3Delight tiled TIFF with many processing options.

    The other exes in \bin appear to be quite useful as well.

     

    SO, it appears that I have a plate full of options to dig into. Now I feel like the kid that won the Golden Ticket and gets to explore the chocolate factory. laugh

  • deepred6502deepred6502 Posts: 297

    Only just got round to using mcjLabelizer, and words can't describe how handy it's proven to be.

Sign In or Register to comment.