<commit_before>import click
import rasterio
from rio_color.workers import atmos_worker, color_worker
from rio_color.operations import parse_operations
import riomucho


@click.command('color')
@click.option('--jobs', '-j', type=int, default=1,
              help="Number of jobs to run simultaneously, default: 1")
@click.option('--out-dtype', '-d', type=click.Choice(['uint8', 'uint16']),
              help="Integer data type for output data, default: same as input")
@click.argument('src_path', type=click.Path(exists=True))
@click.argument('dst_path', type=click.Path(exists=False))
@click.argument('operations', nargs=-1)
@click.pass_context
def color(ctx, jobs, out_dtype, src_path, dst_path, operations):
    """Color correction

Operations will be applied to the src image in the specified order.
Each operation should be a single quoted argument.

Available OPERATIONS include:

\b
    "gamma BANDS VALUE"
        Applies a gamma curve, brightening or darkening midtones.
        VALUE > 1 brightens the image.

\b
    "sigmoidal BANDS CONTRAST BIAS"
        Adjusts the contrast and brightness of midtones.
        BIAS > 50 darkens the image.

\b
    "saturation PERCENTAGE"
        Controls the saturation in LCH color space (similar to HSV).
        PERCENTAGE = 0 results in a grayscale image, 100 is no change,
        and 200 is a lot.

BANDS are specified as a comma-separated list of band numbers or letters:

\b
    `1,2,3` or `R,G,B` or `r,g,b` are all equivalent

Example:

\b
    rio color -d uint8 -j 4 input.tif output.tif \\
        "gamma 3 0.95" "sigmoidal 1,2,3 35 0.13"
    """
    with rasterio.open(src_path) as src:
        opts = src.meta.copy()
        kwds = src.profile.copy()
        windows = [(window, ij) for ij, window in src.block_windows()]

    opts.update(**kwds)
    opts['transform'] = opts['affine']

    out_dtype = out_dtype if out_dtype else opts['dtype']<commit_msg>doc correction: bias is in fraction, not percent<commit_after>import click
import rasterio
from rio_color.workers import atmos_worker, color_worker
from rio_color.operations import parse_operations
import riomucho


@click.command('color')
@click.option('--jobs', '-j', type=int, default=1,
              help="Number of jobs to run simultaneously, default: 1")
@click.option('--out-dtype', '-d', type=click.Choice(['uint8', 'uint16']),
              help="Integer data type for output data, default: same as input")
@click.argument('src_path', type=click.Path(exists=True))
@click.argument('dst_path', type=click.Path(exists=False))
@click.argument('operations', nargs=-1)
@click.pass_context
def color(ctx, jobs, out_dtype, src_path, dst_path, operations):
    """Color correction

Operations will be applied to the src image in the specified order.
Each operation should be a single quoted argument.

Available OPERATIONS include:

\b
    "gamma BANDS VALUE"
        Applies a gamma curve, brightening or darkening midtones.
        VALUE > 1 brightens the image.

\b
    "sigmoidal BANDS CONTRAST BIAS"
        Adjusts the contrast and brightness of midtones.
        BIAS > 0.5 darkens the image.

\b
    "saturation PERCENTAGE"
        Controls the saturation in LCH color space (similar to HSV).
        PERCENTAGE = 0 results in a grayscale image, 100 is no change,
        and 200 is a lot.

BANDS are specified as a comma-separated list of band numbers or letters:

\b
    `1,2,3` or `R,G,B` or `r,g,b` are all equivalent

Example:

\b
    rio color -d uint8 -j 4 input.tif output.tif \\
        "gamma 3 0.95" "sigmoidal 1,2,3 35 0.13"
    """
    with rasterio.open(src_path) as src:
        opts = src.meta.copy()
        kwds = src.profile.copy()
        windows = [(window, ij) for ij, window in src.block_windows()]

    opts.update(**kwds)
    opts['transform'] = opts['affine']

    out_dtype = out_dtype if out_dtype else opts['dtype']
{'fraction_non_alphanumeric': 0.11131198347107438, 'fraction_numerical': 0.017045454545454544, 'mean_word_length': 3.376271186440678, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1518209', 'n_tokens_mistral': 1303, 'n_tokens_neox': 1229, 'n_words': 420}