# Struct oxipng::Options [−] [src]

    pub struct Options {
        pub backup: bool,
        pub out_file: PathBuf,
        pub out_dir: Option<PathBuf>,
        pub stdout: bool,
        pub fix_errors: bool,
        pub pretend: bool,
        pub recursive: bool,
        pub clobber: bool,
        pub create: bool,
        pub force: bool,
        pub preserve_attrs: bool,
        pub verbosity: Option<u8>,
        pub filter: HashSet<u8>,
        pub interlace: Option<u8>,
        pub compression: HashSet<u8>,
        pub memory: HashSet<u8>,
        pub strategies: HashSet<u8>,
        pub window: u8,
        pub bit_depth_reduction: bool,
        pub color_type_reduction: bool,
        pub palette_reduction: bool,
        pub idat_recoding: bool,
        pub strip: Headers,
        pub use_heuristics: bool,
        pub threads: usize,
    }

Options controlling the output of the `optimize` function

## Fields

`backup` | Whether the input file should be backed up before writing the output Default: `false`
`out_file` | Path to write the output file to
`out_dir` | Used only in CLI interface
`stdout` | Write to stdout instead of a file Default: `false`
`fix_errors` | Attempt to fix errors when decoding the input file rather than returning an `Err` Default: `false`
`pretend` | Don't actually write any output, just calculate the best results Default: `false`
`recursive` | Used only in CLI interface
`clobber` | Overwrite existing output files Default: `true`
`create` | Create new output files if they don't exist Default: `true`
`force` | Write to output even if there was no improvement in compression Default: `false`
`preserve_attrs` | Ensure the output file has the same permissions as the input file Default: `false`
`verbosity` | How verbose the console logging should be (`None` for quiet, `Some(0)` for normal, `Some(1)` for verbose) Default: `Some(0)`
`filter` | Which filters to try on the file (0-5) Default: `0,5`
`interlace` | Whether to change the interlacing type of the file `None` will not change the current interlacing type `Some(x)` will change the file to interlacing mode `x` Default: `None`
`compression` | Which zlib compression levels to try on the file (1-9) Default: `9`
`memory` | Which zlib memory levels to try on the file (1-9) Default: `9`
`strategies` | Which zlib compression strategies to try on the file (0-3) Default: `0-3`
`window` | Window size to use when compressing the file, as `2^window` bytes Doesn't affect compression but may affect speed and memory usage 8-15 are valid values Default: `15`
`bit_depth_reduction` | Whether to attempt bit depth reduction Default: `true`
`color_type_reduction` | Whether to attempt color type reduction Default: `true`
`palette_reduction` | Whether to attempt palette reduction Default: `true`
`idat_recoding` | Whether to perform IDAT recoding If any type of reduction is performed, IDAT recoding will be performed regardless of this setting Default: `true`
`strip` | Which headers to strip from the PNG file, if any Default: `None`
`use_heuristics` | Whether to use heuristics to pick the best filter and compression Intended for use with `-o 1` from the CLI interface Default: `false`
`threads` | Number of threads to use Default: 1.5x CPU cores, rounded down

## Trait Implementations

### `impl Default for Options`

#### `fn default() -> Options`

### Derived Implementations

### `impl Debug for Options`

#### `fn fmt(&self, __arg_0: &mut Formatter) -> Result`

### `impl Clone for Options`

#### `fn clone(&self) -> Options`

#### `fn clone_from(&mut self, source: &Self)`1.0.0

# Help

## Keyboard Shortcuts

?
  Show this help dialog
S
  Focus the search field
⇤
  Move up in search results
⇥
  Move down in search results
⏎
  Go to active search result

## Search Tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g. `vec -> usize` or `* -> vec`)