Install OpenCVThe script which resizes images cannot be used from inside Blender, because it uses the OpenCV library which is not included in Blender python. Installing OpenCV is quite complex, but the instructions at https://www.learnopencv.com/ are very useful.
Other operating systems: https://www.learnopencv.com/?s=install.
On Windows you start by installing the following software:
- Visual Studio.
- Anaconda. I installed the Python 3 version but Python 2 will probably work too.
- Git for Windows.
UsageIn Blender, import a DAZ scene as usual. Save the blend file and press Save Local Textures. This creates a subdirectory called textures and copies all used textures there. Note that this button has been moved from the Finishing section to the Materials section in the Setup panel.
The downsizing script is called resize.py and is located in the standalone folder. Once OpenCV has been installed, open the command prompt, go to the standalone folder, and type
python resize.py <path to texture directory> <resize steps>
This creates new textures whose resolution is 1/2^steps of the original resolution, where steps is an integer between 0 and 4. E.g., if the original image has 4096x4096 pixels and steps = 2, the downsized image has 1024x1024 pixels. The total number of pixels is thus reduced by a factor 16.
ResultsHere are the results on my computer for a scene with a single nude Genesis 8 Female:
|Step||Total size||Render time|
|Original||0||24.9 Mb||59.24 s|
|25%||2||3.79 Mb||55.92 s|
|6.25%||4||342 kb||56.23 s|
When going to maximal downsizing, the total disk space occupied by the textures is reduced by more than a factor 70. This is less than the factor 256 that one would naively expect for a bitmap, because the images are stored in compressed formats such as jpg or png. On the other hand, the render time (with Cycles on Blender 2.79b) does not change significantly in this case, because all textures fit into RAM memory. In realistic scenes, which contain multiple characters with hair and clothes, the original textures may fill up RAM memory and Blender starts swapping to disk. In that case the reduction in render time will be dramatic.
Update July 28, 2019:
When the Resize Textures button is pressed, a pop-up menu appears and asks for the number of rescale steps; one step means that the texture is rescaled by 50% in each direction, two steps that the scale factor is 25%, etc.
|Steps||Scale factor||File name|
This button only replaces the textures in the Blender materials; the rescaled textures must already exist in the same directory. If you have access to some other program that resizes image files, you can of course use that instead of the standalone script bundled with the DAZ Importer, as long as you follow the naming convention above.
If you know that you will never need the original, high-resolution image files, you can alternatively overwrite the original filenames with the scaled files and reload the blend file.