Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add command-line wrapper for Pyxelate. #28

Merged
merged 5 commits into from Dec 13, 2021
Merged

Conversation

mdwelsh
Copy link
Contributor

@mdwelsh mdwelsh commented Dec 8, 2021

This PR adds a small wrapper around Pyxelate which can be invoked with the "pyxelate" command once installed.

Example usage:

$ pyxelate input.jpg output.png --factor 10 --palette PICO_8

Here is the full help message:

$ pyxelate --help
usage: pyxelate [-h] [--width WIDTH] [--height HEIGHT] [--factor FACTOR]
                [--upscale UPSCALE] [--depth DEPTH] [--palette PALETTE]
                [--dither {none,naive,bayer,floyd,atkinson}] [--sobel SOBEL]
                [--alpha ALPHA] [--noboost] [--quiet]
                INFILE OUTFILE

positional arguments:
  INFILE                Input image filename.
  OUTFILE               Output image filename.

optional arguments:
  -h, --help            show this help message and exit
  --width WIDTH         Output image width.
  --height HEIGHT       Output image height.
  --factor FACTOR       Downsample factor.
  --upscale UPSCALE     Upscale factor for output pixels.
  --depth DEPTH         Number of times to downscale.
  --palette PALETTE     Number of colors in output palette, or a palette name.
                        Valid choices are: ['TELETEXT', 'BBC_MICRO',
                        'CGA_MODE4_PAL1', 'CGA_MODE5_PAL1', 'CGA_MODE4_PAL2',
                        'ZX_SPECTRUM', 'APPLE_II_LO', 'APPLE_II_HI',
                        'COMMODORE_64', 'GAMEBOY_COMBO_UP',
                        'GAMEBOY_COMBO_DOWN', 'GAMEBOY_COMBO_LEFT',
                        'GAMEBOY_COMBO_RIGHT', 'GAMEBOY_A_UP',
                        'GAMEBOY_A_DOWN', 'GAMEBOY_A_LEFT', 'GAMEBOY_A_RIGHT',
                        'GAMEBOY_B_UP', 'GAMEBOY_B_DOWN', 'GAMEBOY_B_LEFT',
                        'GAMEBOY_B_RIGHT', 'GAMEBOY_ORIGINAL',
                        'GAMEBOY_POCKET', 'GAMEBOY_VIRTUALBOY',
                        'MICROSOFT_WINDOWS_16', 'MICROSOFT_WINDOWS_20',
                        'MICROSOFT_WINDOWS_PAINT', 'PICO_8', 'MSX',
                        'MONO_OBRADINN_IBM', 'MONO_OBRADINN_MAC', 'MONO_BJG',
                        'MONO_BW', 'MONO_PHOSPHOR_AMBER',
                        'MONO_PHOSPHOR_LTAMBER', 'MONO_PHOSPHOR_GREEN1',
                        'MONO_PHOSPHOR_GREEN2', 'MONO_PHOSPHOR_GREEN3',
                        'MONO_PHOSPHOR_APPLE', 'APPLE_II_MONO',
                        'MONO_PHOSPHOR_APPLEC', 'APPLE_II_MONOC']
  --dither {none,naive,bayer,floyd,atkinson}
                        Type of dithering to use.
  --sobel SOBEL         Size of the Sobel operator.
  --alpha ALPHA         Alpha threshold for output pixel visibility.
  --noboost             By default, adjust contrast and apply preprocessing on
                        the image before transformation for better results. In
                        case you see unwanted dark pixels in your image, use
                        --noboost.
  --quiet               Suppress logging output.

@sedthh
Copy link
Owner

sedthh commented Dec 13, 2021

Thanks man this is great!

@sedthh sedthh merged commit c2be1ec into sedthh:master Dec 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants