INNER CODE UNIT · Python

resolve_output_path

KennethJAllen/proper-pixel-art · proper_pixel_art/cli.py:208

def resolve_output_path(
    out_path: Path, input_path: Path, suffix: str = "_pixelated"
) -> Path:
    """
    If out_path is a directory, make it a file path with filename
    ``(input stem){suffix}.png`` (main passes the output size as the suffix,
    e.g. ``sprite_128x128.png``). An out_path that already names a file is
    returned unchanged.
    """
    return utils.build_output_path(out_path, input_path, suffix, ext="png")


def main() -> None:
    args = parse_args()
    input_path = Path(args.input_path).expanduser()

    config = PixelateConfig.from_yaml(args.config) if args.config else None

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…