Utilities Guide > Toon Boom Utilities Guide > Chapter 2: Utilities > Pix2vec Utility

Pix2vec Utility

The Pix2vec program converts bitmap files, which can be generated during the scanning process, to Toonboom Vector Graphic (TVG) files. TVG is the vector file format for Toon Boom professional software.

You can vectorize SCAN and other bitmap files by running Pix2vec from the command line. There are a number of options you can use. To see a list of the vectorization options, type pix2vec --help or pix2vec -? .

Here is the format you must follow when using Pix2vec:

$ Pix2vec -file [file name, including extension] [options]

Here are the available Pix2vec options:

 

COMMAND

ACTION

FILE IO OPTIONS

 

-file <filename (including extension)> [ options ]

Use this option to define the file you want to perform Pix2vec on.

-infile <filename (including extension)>

This option is the same as -file.

Use this option to define the file you want to perform Pix2vec on.

-outfile <filename>

Use this option to rename the output file.

-informat <format>

This option defines the input format. Used if reading from standard input.

-debug

Use this option to turn on the debug mode.

-version

This option will display the version information.

-output_version <version>

This option defines the output files of this version. Valid versions can be: 0 or 604. The TVG format version is 604.

-noforce

This option will prevent the output image from being forced if the image is inconsistent.

REGISTRATION OPTIONS

 

-register

Use this option to perform optical registration. Follow this format:

<dpi side strictness>;

The Side position can be left, right, top, bottom or l, r, t, b.

The Strictness can be either loose, strict or l, s.

-registration_looseness_factor <factor>

Registration looseness factor (by default the looseness factor is 2.0). This is used for optical registration only and is calculated mathematically by the system.

-rlf

This option is the short hand equivalent of the registration_looseness_factor function.

-rdebug

This option output registration debug messages

-pegpitch <inch (default 8.000000)>

Use this option to customize the value of the distance between the registration marks.

-threshr < (default 0.500000)>

Use this option to set the threshold value for optical registration.

You can set the value in the range of 0.0 to 1.0.

-rmargin <inch (default 1)>

Use this option to define the size of the region where registration marks can be detected.

-peg_distance_from_center <inch (default 5.25)>

Use this option to determine the distance between the centre of your page to the peg registration marks.

-pdfc

This function is the short equivalent of peg_distance_from_centre.

Use this option to determine the distance between the centre of your page to the peg registration marks.

-out_peg_position <side (default same)>

This option defines the wanted position of the peg on the drawing.

The position can be right, left, top, bottom, r, l, t, b or same.

A rotation will be performed if this position is different from the side passed to -register.

-output_peg_matrix

This option outputs the peg transformation matrix on standard output.

-scanner_calibrate < (default 1.0000 1.0000) >

This option sets the x and y scale factors to be applied to scanner image.

FILTERING OPTIONS

 

-pixel <pixel_shape (default '4x3')>

The valid value is: 4x3.

-gap <worldUnits (default 10)>

Use this option to set the size of gaps that will be automatically closed.

-pencil

Use this option to generate line art only.

-keep_dirt

Use this option to not filter dirt.

-thresh <threshold (default 0.2)>

Use this option to set the threshold value.

-rmv_hairs <worldUnits (default 1)> <passes (default 1)>

Use this option to remove hair smaller than the defined size in a specific number of passes.

-rmv_holes <area (default 7)>

Use this option to remove holes smaller than the defined area size.

-rmv_dirt <area (default 1)>

This option will remove dirt smaller than the defined size. You can set values in the range of 100 to 500. The size, or area, is in world units squared.

-rmv_triangles <worldUnits (default 30.000000)>

Use this option to remove triangles at the defined pixel distance from each other.

You can use -no_break to remove all triangles.

-no_texture

This option prevents textured strokes to be generated.

-color_as_texture

This option will vectorize the alpha channel and put the RGB colour in a textured colour.

-noclosegap

This option will prevent gaps from being automatically closed.

-no_break

This option disables the breaking of line art.

-jag_filter <pixels (default 0>

This option will expand the pixels in the vectorization bitmap to give a jagged line a more straight and smooth result.

This makes use of the -expand_bitmap option to expand the line by 1 or 2 pixels and then contract it by the same amount, removing any jaggedness from the line in the process.

-expand_bitmap <pixels (default 0>

This option expand the pixels in the vectorization bitmap.

This is used to thicken the line.

-fit_errorc <error (default 1.000000>

This option defines the fit error for the colour art.

A fit error occurs when there are three points on a curved or angled line and the system misses the middle point. For example, instead of a the line going from point 1 up to point 2 and then down to point 3, to form a curve or angled line, it goes from point 1 to point 3 missing point 2 and creating a straight line. Using the -fit_error option eliminates this error.

-fit_errorl <error (default 1.000000>

This option defines the fit error for the line art.

A fit error occurs when there are three points on a curved or angled line and the system misses the middle point. For example, instead of a the line going from point 1 up to point 2 and then down to point 3, to form a curve or angled line, it goes from point 1 to point 3 missing point 2 and creating a straight line. Using the -fit_error option eliminates this error.

-smoothl <passes (default 1>

This option defines the number of smooth passes for the line art.

-smoothc <passes (default 1>

This option defines the number of smooth passes for the colour art.

-first_smooth <passes (default 0>

This option defines the number of smooth passes on the line art before breaking triangles.

-first_smoothl <passes (default 0>

This option defines the number of smooth passes for line art before breaking triangles.

-first_smoothc <passes (default 0>

This option defines the number of smooth passes to perform. For line art in colour art pass (needs -2pass).

-2pass

This option specify 2 sets of parameters; one for line art "l", one for colour art "c"(-thresh, -rmv_holes and -rmv_dirt will be overridden by -threshl, -threshc, -rmv_holesl, -rmv_holesc, -rmv_dirtl and -rmv_dirtc).

-threshl <threshold for line art (default 0.5)>

This option sets the threshold value for the line art.

Range can be from 0.0 to 1.0.

-threshc <threshold for color art (default 0.5)>

This option sets the threshold value for the colour art.

Range can be from 0.0 to 1.0.

-jag_filterl <pixels (default 0>

This option expands the pixels in the vectorization bitmap for line art. To smooth and straighten jagged lines.

-jag_filterc <pixels (default 0>

This option expands the pixels in the vectorization bitmap for colour art. To smooth and straighten jagged lines.

-expand_bitmapl <pixels (default 0>

This option expands the pixels in the vectorization bitmap for line art.

-expand_bitmapc <pixels (default 0>

This option expands the pixels in the vectorization bitmap for colour art.

-rmv_holesl <area (default 7)>

This option removes line art holes smaller than the specified area.

-rmv_holesc <area (default 7)>

This option removes colour art holes smaller than the specified area.

-rmv_dirtl <area (default 1)>

This option will remove dirt on the line art that is smaller than the defined size.

You can set values in the range of 100 to 500. The size, or area, is in world units squared.

-rmv_dirtc <area (default 1)>

This option removes dirt on the colour art that is smaller than the defined size.

You can set values in the range of 100 to 500. The size, or area, is in world units squared.

-margins <inch (default 0.25)>

This option removes the margin around bitmap.You must define the size of the margin in inches.

-top_margin <inch (default 0.25)>

This option removes the top margin of bitmap. You must define the size of the margin in inches.

-bottom_margin <inch (default 0.25)>

This option removes the bottom margin of bitmap. You must define the size of the margin in inches.

-left_margin <inch (default 0.25)>

This option removes the left margin of bitmap. You must define the size of the margin in inches.

-right_margin <inch (default 0.25)>

This option removes the right margin of bitmap. You must define the size of the margin in inches.

-remove_peg_bars

This option removes the registration marks.

-field_size <fields (default 12 or use value in scan file)>

This option sets the drawing to this field size.

-fs

This is the abbreviated version of -field_size function.

Use this option to set the drawing field size.

-peg_bar_size <inch (default 1)>

This option sets the size of the peg bar region.

-noframe

This option prevents a frame being added around the colour art.

-frame_fields <default -1.000000>

This option will put a frame of the specified dimension around the colour art.

-downscale_input <default 1> t

This option downscales the raw input by this integer factor.

-downscale_texture <default 1>

This option downscales the output texture by this integer factor.

-buildmatte

This option will automatically generate a matte on the underlay layer for quick line test.

-buildmatte_colourart

This option will automatically generate a matte on the colour art layer for quick line test.

-copystrokes

This option will copy the original strokes when building the matte.

Note that -buildmatte and -buildmatte_colourart are mutually exclusive.

Options for bitmap that have no registration information

 

-pixel_margins <inch (default 0)>

This option sets the size in inches for the bitmap margin.

-top_pixel_margin <inch (default 0)>

This option sets the size value in inches for the bitmap top margin.

-bottom_pixel_margin <inch (default 0)>

This option sets the size value in inches for the bitmap bottom margin.

-left_pixel_margin <inch (default 0)>

This option sets the size value in inches for the bitmap left margin.

-right_pixel_margin <inch (default 0)>

This option sets the size value in inches for the bitmap right margin.

-dpi <(default -1)>

This option defines the dpi information of input bitmap.

RGB KEYING OPTIONS

 

-rgb

Use this option to generate separate zones for red green and blue lines.

-rgb_alpha <value (default 255)>

Use this option to set an alpha value for red, green and blue colours.

-no_red

Use this option to ignore the colour red during vectorization.

-no_green

Use this option to ignore the colour green during vectorization.

-no_blue

Use this option to ignore the colour blue during vectorization.

-flatten

Use this option to perform a flatten on the drawing after generating the colours.

-rmv_rgb_dirt <threshold area default 0.0>

Use this option to remove red, green and blue regions smaller than the specified area.

-expand_bitmap_rgb <pixels (default 0>

This option expands the pixels in the vectorization bitmap for rgb.

-threshrgb <value> <threshold for rgb vectorization default 0.200000>

This option defines the thresholds on rgb vectorization and value to consider a pixel to be gray.

-threshsv <saturation threshold default 0.500000> <value threshold default 0.500000>

This option defines the thresholds on saturation and value to consider a pixel to be gray.

COLOUR VECTORIZATION OPTIONS

Note that the following colour vectorization options are experimental.

-color_vectorize

Use this option to perform a colour vectorization.

-file2 <color art filename>

This option specifies the colour art bitmap file to perform vectorization on.

-penstyle <center alpha (0.0-20.0)> <edge alpha (0.0-20.0)> <gamma (0-10)> <centre pressure effect (0.0-1.0)> <edge pressure effect (0.0-1.0)><texture bitmap downscaling (0.2-20)> <texture bitmap file (valid filename or "" if no file)>

Use this option to generate and set a brush texture for the line art.

-pressure_variation <strategy (0, 1 or 2)> <min pressure (0.0-1.0)> <max pressure (0.0-1.0)> <max variation (0.0-1.0)>

This option specifies a pressure strategy for the centre line.

-blur_radius <pixels (default 0)>

This option blurs the generated brush texture.

-color_contour_smooth_passes <times (default 3)>

This option sets the performed number of smooth passed on contour before computing texture.

-ccsp <times (default 3)>

This is the abbreviated version of the -color_contour_smooth_passes function.

This option sets the performed number of smooth passed on contour before computing texture.

-color_rmv_holesl <world units (default 0.000000)>

This option sets the size of holes to be removed when computing texture.

-color_fill_holesl <world units (default 0.000000)>

This option will automatically fill holes of the selected size on the colour art layer.

BUBBLE USAGE

(implemented only for colour vectorization's line art)

To learn more about the Bubble command, refer to the How to Vectorize With Bubbles section.

-create_bubbles

This option modifies the original line art of a drawing by randomly inserting bubble shapes in it.

-bubble_gap <value (default 3)>

This option defines the maximum number of colour art points between two consecutive bubbles.

-bubble_length <value (default 10)>

This option defines the maximum number of different radius circles in a single bubble.

-min_radius <value (default 1.5000)>

This option defines the minimum radius of a circle in a bubble relative to the line thickness (must be >= 1.0).

-max_radius <value (default 3.5000)>

This option defines the maximum radius of a circle in a bubble relative to the line thickness (must be >= 1.0).

-uniform_gap

This option specifies that the bubbles should be placed at equal distance from each other.

-uniform_height

This option forces the height of the bubbles to be the same for all bubbles.