Compoz

for DS 1,2,3,4

══════════════════

Introduction

══════════════════

compoZ a compositing script (creates batch files)

manual for compoz.ds v1.0

===========================================

══════════════════

History

══════════════════

January 10th 2012 : script settings are saved to the registry on exit, recovered on next launch, version for DS 1, 3 and 4 added

February 1st 2008 : v1.0 released

--------------------------------------------------------------------------------------------

══════════════════

Credits

══════════════════

--------------------------------------------------------------------------------------------

Ideas by neon22 and Casual implemented by Casual

The above are Daz3D forum aliases

══════════════════

Purpose

══════════════════

Images rendered by DazStudio (except .jpg) contain a

transparency map or Alpha channel. Everything in the image

not occupied by an object or figure is deemed transparent.

Using a "compositing" utility you can combine a rendered

(foreground) image with a second (background) image.

This script will build a batch (.bat) file that in turn will

repeatedly run the compositing utility and combine two

series of images into one.

The batch (.bat) files generated by this script may not be

compatible with Mac and Unix OSes

══════════════════

Installation

══════════════════

You should place the present script (compoZ.ds) and the associated

icon image (compoZ.png) in your daz studio script folder, usually

C:\Program Files\Daz\Studio\Contents\Script

Although other utilities could be used for image compositing,

this script was designed with ImageMagick in mind.

So first you need to get and install the free imaging suite

ImageMagick which you can get from the official web site:

http://www.imagemagick.org

You only need to install the windows binaries located here:

http://www.imagemagick.org/script/binary-releases.php#windows

══════════════════

Use

══════════════════

=========================================================

Section 1 : Background Images

=========================================================

In this section you specify the location of the numbered images that will be used

as background images in the compositing process.

Using Daz Studio you can render an animation as a series of numbered images.

Using freeware like VirtualDub or almost any movie editor, you can convert

a video (avi mpg etc) into a series of numbered images.

As an example we will consider the case where you created 100 numbered

background images and placed them in a folder named C:\job001\bkgpics

The images are all prefixed "pic". The image numbers are padded with 3 zeros.

-----> pic001.png, pic002.png, pic003.png .... pic100.png,

++++++++++++++++++++++++++++++

"Loop Range Start Image Number"

and

"Loop Range End Image Number"

If the foreground animation lasts longer than the background image series, looping

will occur. Here you specify the looping range.

In our example, we should specify 1 as the "Loop Range Start Image Number"

and 100 for "Loop Range End Image Number"

++++++++++++++++++++++++++++++

First Image Used Number

The number of the first background image that will be composited with the first

forground image. Usually this number will be the same as the "Loop Range Start Image Number"

parameter ( 1 in our example ).

++++++++++++++++++++++++++++++

Filename prefix

In our example, the image prefix is pic

++++++++++++++++++++++++++++++

File Number Padding

Some programs output numbered image with "zero padding".

In our example (pic001.png) the filename numbers are padded with three zeros.

If your program outputs numbered images unpadded ( pic1.png) then set

File Number Padding to 0

++++++++++++++++++++++++++++++

Image format

The background images dont need a transparency map, so all image formats

are allowed. Formats must be one of the many supported by Imagemagick

here's the most used bmp jpg png tga gif. Do not include the period/dot (.).

in our example, "Image Format" is png

++++++++++++++++++++++++++++++

Path To Images

Location of the directory holding your series of background images.

The [...] button can be used to browse up to this directory. Note the absence

of a trailing backslash at the end of the path.

In our example, C:\job001\bkgpics

=========================================================

Section 2 : Foreground Images

=========================================================

In this section you specify the location of the numbered images that will be used

as foreground images in the compositing process.

Using Daz Studio you can render an animation as a series of numbered images.

And those images contain the required "alpha channel" or transparency map.

If the images supplied dont contain this feature ( example if you are trying to use jpg images)

the background images wont show through the foreground images

As an example we will consider the case where you created 300 numbered

background images and placed them in a folder named C:\job001\frgpics

The images are all prefixed "pic". The image numbers are padded with 3 zeros.

-----> pic000.png, pic001.png, pic002.png .... pic299.png,

++++++++++++++++++++++++++++++

"Start Frame " and "End Frame"

The range of foreground images that will be composited on top of the backround images

in our example, this could be 0 and 299

++++++++++++++++++++++++++++++

Filename prefix

In our example, the image prefix is pic

++++++++++++++++++++++++++++++

File Number Padding

Some programs output numbered image with "zero padding".

In our example (pic000.png) the filename numbers are padded with three zeros.

If your program outputs numbered images unpadded ( pic0.png) then set

File Number Padding to 0

++++++++++++++++++++++++++++++

Image format

The foreground images do need a transparency map, but other than that,

all 100 image formats supported by Imagemagick can be used

here's the most common: bmp jpg png tga gif.

Do not include the period/dot (.) in the "Image Format"

in our example, "Image Format" is png

++++++++++++++++++++++++++++++

Path To Images

Location of the directory holding your series of foreground images.

The [...] button can be used to browse up to this directory. Note the absence

of a trailing backslash at the end of the path.

In our example, C:\job001\frgpics

=========================================================

Section 3 : Output Images (composited)

=========================================================

In this section you specify the location of the numbered images that will be

created by the compositing process.

As an example we will consider the case where you want to create

270 images numbered 30 to 299 and have them placed in a folder named

C:\job001\outpics

You want your images to be prefixed "pic".

You want your image numbers to be padded with 3 zeros.

-----> pic030.png, pic031.png, pic032.png .... pic299.png,

++++++++++++++++++++++++++++++

First Frame Number

An offset for the image numbers of the files created by compositing.

In our example, "First Frame Number" is 30

In most cases you'll leave "First Frame Number" at 0

++++++++++++++++++++++++++++++

Filename prefix

In our example, the image prefix is pic

++++++++++++++++++++++++++++++

File Number Padding

The composited images produced by the batch file (bat) built by this script

will usually be converted into a video file (avi mpg mov). Some programs

like bmptoavi or virtualdub require filename numbers to be "zero padded"

in our example we set the padding to 3

so our filenames will look like

-----> pic030.png, pic031.png, pic032.png .... pic299.png,

if the output format was bmp, these filenames would be usable for conversion to avi

using bmp2avi

if you dont want zer0-padding, then set "File Number Padding" to 0

-----> pic30.png, pic31.png, pic32.png ... ppic299.png,

++++++++++++++++++++++++++++++

Image format

The composited images will not include a transparency map.

so all 100 image formats supported by Imagemagick can be used

here's the most common: bmp jpg png tga gif.

Do not include the period/dot (.) in the "Image Format"

in our example, "Image Format" is png

++++++++++++++++++++++++++++++

Path To Images

Location of the directory that will be holding your series of composited images.

The [...] button can be used to browse up to this directory. You can also use this

browser to create new directories (folders).

Note the absence of a trailing backslash at the end of the path.

In our example, C:\job001\outpics

=========================================================

Section 4 : Batch File Creation

=========================================================

Here you specify how the batch (.bat) file will be created by this script

++++++++++++++++++++++++++++++

Path To Compositing Utility

Specify where the compositing utility is located. Since i installed ImageMagick

in my C:\imagemagick directory, that the value i give to "Path To Compositing Utility"

++++++++++++++++++++++++++++++

Compositing formula (Advanced users)

If you have a good understanding of the compositing utilities you can

modify this formula

default value: composite -compose atop -geometry 640x480

the end part that reads 640x480 means that the foreground and background images

will be resized to 640 pixels by 480 pixels before being saved at this size

If your foreground images are 320x240 pixels, you probably want to change the formula to

composite -compose atop -geometry 320x240

++++++++++++++++++++++++++++++

Path to the batch file created by this script

Specify the location of the directory where you want this sscript to create the compositing

batch (bat) file.

══════════════════

Thanks

══════════════════


Thanks to DAZ Forum Team member Richard Haseltine

for help on the initial idea which may be implemented soon

══════════════════

Disclaimer

══════════════════

We do not claim any copyrights for this script

We are not affiliated with Daz nor is this script endorsed by them.

We are not affiliated in any way with the makers of ImageMagick

(ImageMagick Studio LLC) and this script is not endorsed by them

You can read ImageMagick's license here:

http://www.imagemagick.org/script/license.php

This script has not been tested extensively, The code was

written to prevent users from doing simple errors. This is not

a commercial product it's just a script posted on a forum.

If you're not careful you may even overwrite precious images, or fill

your hard disk with 100000 images.

In no event shall the author be liable for any damages whatsoever

arising out of the use of or inability to use this script, the batch

files it produces and the documentation,

// ideas by neon22 amd Casual implemented by Casual

// the above are Daz3D forum aliases

//

// thanks to DAZ Forum Team member Richard Haseltine

// for help on the initial idea which may be implemented soon

// v1.0 released february 1st 2008

//

// We are not affiliated with Daz nor is this script endorsed by them

//

// Although other utilities could be used for image compositing,

// this program was designed with ImageMagick in mind.

//

// This script creates batch (.bat) files.

// When run/executed the batch files repeatedly launches

// the image compositing utility ( usually ImageMagick )

//

// We are not afiliated in any way with the makers of ImageMagick

// (ImageMagick Studio LLC) and this script is not endorsed by them

//

// You should download and install ImageMagick on your PC

// from the official web site: http://www.imagemagick.org

// You only need to install the windows binaries

// located here: http://www.imagemagick.org/script/binary-releases.php#windows

//

// I doubt this script/batch system works on a MAC or on Unix

//

// This is a DasStudio script script should be placed under your DazStudio