On this page

Auto-crops an image by shrinking the resolution or data window size to fit the image. This can be used to create smaller files by cutting out black space.

Synopsis

iautocrop [-b border_padding] [-c crop_value] [-f] [-i] [-n] [-p analyze_planes] [-q] [-r] infile [outfile]

where:

-b

Specify border padding of the crop area. Once the crop area is determined, an addition number of pixels can be added to each side, creating a slightly larger image. The default is zero.

-c

Specify the crop value. All values less that the crop_value are considered to be safe to crop away. The default is zero.

-f

Fully crop the image. If a format supports a data window, normally the data window is set and the resolution left intact. This option will instead change the resolution of the image instead of setting the data window. Formats that do not support a data window are fully cropped by default, otherwise this is off by default.

-i

Information mode only. Print the crop region that would be applied rather than writing a file.

-n

Only create a new file if a cropping is needed. This is ignored if -r (replace file) is used. If not specified, the source file is copied to the destination file if the crop region is the same.

-p

Specify a list of planes to analyze when comparing pixel values to the crop value. The default is C A (color and alpha). A * indicates that all planes will be considered when determining the crop area.

-q

Quiet mode. Don’t print errors or warnings. -i will still print its output if given, but other messages will be suppressed.

-r

Replace original file with the cropped version. outfile does not need to be given and will be ignored.

Description

Auto-crop shrinks the resolution or data window to the "interesting area" of an image. This region is always rectangular. The pixels outside the area of interest have values less than the crop_value (default 0). For multi-plane images, such as .pic or .exr, the planes to analyze for the crop region can be specified with the -p option (the default is analyze C and A).

Cropping can be done in-place (overwriting the image) with the -r option, or to a different file if a second filename is given.

Some image formats support a data window, where the resolution of the image is not the same as the area containing the image data. Often this is used as a compression or performance feature. By default, these formats will have their data window adjusted to match the auto-cropped region (unless -f, full crop, is specified). Formats that do not support data windows will be fully cropped, meaning their resolution will be changed to the crop area.

Examples

To adjust the data window of an EXR image to all color values zero and above:

iautocrop -p "C" example.exr cropped.exr

To replace an image with a fully cropped version of itself:

iautocrop -f -r image.pic

To adjust the data window of an EXR image with a small buffer area of 3 pixels around the image data:

iautocrop -b 3 -r example.exr

To print the crop region of all pixels at least 10% gray in a JPEG:

iautocrop -i -c 0.1 image.jpg

Stand-alone utilities

  • abcconvert

    Convert between Alembic formats.

  • abcecho

    Print information about an Alembic file.

  • abcinfo

    Print information about an Alembic file.

  • chchan

    Copies channel collection to/from action channel format.

  • chcp

    Copies channel collection file to another format.

  • chinfo

    Prints information about a channel collection file.

  • claudio

    Copies CHOP data (clip) to/from audio formats.

  • clchan

    Copies CHOP data (clip) to/from action channel format.

  • clchn

    Copies CHOP data (clip) to/from channel collection format.

  • clcp

    Copies CHOP data (clip) to another format.

  • clinfo

    Prints information about a CHOP data (clip) file.

  • dsmconvert

  • dsmmerge

  • dsparse

    Parses and displays dialog scripts.

  • gabc

    Convert between Alembic and Houdini geometry.

  • gconvert

    Convert between Houdini polygon formats.

  • gdxf

    Converts DXF polygons to/from Houdini format.

  • geps

    Converts EPS files to Houdini polygon format.

  • giges

  • ginfo

    Prints polygon file statistics.

  • glightwave

    Converts LightWave files to/from Houdini format.

  • gplay

    Geometry viewer.

  • gptex

    Makes a ptexture image file from a geometry file.

  • greduce

    Reduces polygons in a file.

  • gwavefront

    Converts .obj files to/from Houdini format.

  • hbrickmap

    Converts an i3d file or volume primitive geo/bgeo file into a Pixar brickmap file.

  • hcollapse

    Collapses a directory structure.

  • hcpio

  • hexpand

    Expands hip files into a directory structure.

  • hrender

  • hsc

  • hscript

    Command line HScript interpreter.

  • i3dconvert

  • iautocrop

    Crops images based on pixel values.

  • icineon

    Convert images from 10-bit Cineon format to an 8 bit format.

  • icomposite

  • iconvert

    Converts image formats.

  • icp

    Isolate a region of an image in a new image.

  • iflip - Flip Image

  • ihot

    Scans an image for video-unsafe colors.

  • iinfo

    Outputs information about an image.

  • ilut

    Generates a lookup table (LUT) from standard channel formats or another LUT.

  • ilutcomp

    Generates a single lookup table (LUT) from from two LUTs.

  • ilutinfo

    Prints information about a lookup table (LUT) file.

  • imdisplay

    Sends an image to an mdisplay window.

  • iprint

    Prints the RGBA values for an image as text.

  • iquantize

    Reduces the number of colors in an image.

  • isixpack

    Generates an environment/reflection map from six images representing the six sides of a cube, or a cross image.

  • itilestitch

    Assemble a series of image files with crop windows into a single image.

  • izg

    Converts Z-depth images to 8-bit grayscale images.

  • izmatte

    Composites RGB and Z-depth images.

  • mcacclaim

    Converts an Acclaim motion file to a Houdini script and channel file(s).

  • mcbiovision

    Converts a BioVision motion file to a Houdini script and channel file(s).

  • mcmotanal

    Converts a Motion Analysis TRC motion file to a Houdini script and channel file(s).

  • mcp

    Convert an image sequence to a movie file.

  • minfo

    Prints information about movie files.

  • siminfo

    Prints simulation cache file statistics.

  • spy

    Shell utility for navigating the UNIX filesystem.

  • vexcache

    Query or modify the VEX compile cache.

  • vexexec

    Execute a cvex shader.