Support > Scripts > Resize Full Color Level

ToonzScript Code

// Define the Input and Output folders

dir1 = "C:\\Toonz 7.0 stuff\\SCRIPT IMAGES IN\\";
dir2 = "C:\\Toonz 7.0 stuff\\SCRIPT IMAGES OUT\\";

// Define a transformation that scales the image at 150% of its original size

t1 = new Transform().scale(1.5);

// Define a new image builder for creating an Image with resolution 1200x1000

ib = new ImageBuilder(1200,1000);

// Define a new level and load the sequence you want to resize (name..tif)

a = new Level().load(dir1+"name..tif");
print("loaded\n",a);

// Create a new empty level (the resized sequence will be stored in this level)

b=new Level();

// Create a list (ll) containing the Ids of all the frames in level a

ll=a.getFrameIds();

// Create a for cycle that does the following actions:
// Clean the image builder
// Create a new image where the resized image with the current ID is loaded
// Set a frame in level b identified by the current Id (ll[i]) and containing the resized image
// The cycle is repeated for each frame of the .tif sequence as defined in the for line

for(i=0; i<a.frameCount;i++)
{
ib.clear();
myimage=a.getFrame(ll[i]);
b.setFrame(ll[i], ib.add(myimage, t1).image);
print("building frame " + ll[i] + "\n");
}

// Save the resized level

b.save(dir2+"resized_name..tif");
print("saved\n",b);

// Open a flipbook window and display the saved level

view(b);