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

Resolve 11 - CLI #13

Merged
merged 25 commits into from
Apr 25, 2021
Merged

Resolve 11 - CLI #13

merged 25 commits into from
Apr 25, 2021

Conversation

Wabri
Copy link
Member

@Wabri Wabri commented Jul 25, 2020

  • Choose palette dynamically
  • Specify image source
  • Create help page
  • Specify output image name
  • Quiet mode: no output
  • Specify algorithm with pixel average and pixel area to consider for the average
  • Blur or not blur, this is the blur

Resolve #11

@Wabri Wabri self-assigned this Jul 25, 2020
@Wabri Wabri added the enhancement New feature or request label Jul 26, 2020
@Wabri
Copy link
Member Author

Wabri commented Jul 26, 2020

To run the cli is necessary to use a python 3 from the root of the project:

python src/cli.py

There are some arguments that can be passed:

  • --<palette>[=<list_colors_set>] the palette can be found on the src/palettes/ directory (actually there is only nord), by replace the palette with the name is possible to select the theme and if necessary you can specify the set of colors you want to use. Ex: python src/cli.py --nord=aur,p,s is possible to pass the name of the color or the first character of the name set.
  • --img=<image_source> simply put the local path of the image you want to convert

@Wabri
Copy link
Member Author

Wabri commented Aug 8, 2020

Test with all arguments passed (without help, version and quiet mode)
2020-08-08-17-51-58_1062x225

Test with error on img argument:
2020-08-08-17-54-05_1026x104
It fails because the input image name do not have any extension selected
The cli fail also if the image is not given:
2020-08-08-17-56-06_882x102

The cli fail if the arguments out is passed without any value:
2020-08-08-17-57-33_871x120

If the name of the output image is passed without any extension the cli put the default one (for now I set the png, but we can change it):
2020-08-08-17-58-41_875x239

If the no_average argument is passed with a value the cli return an error (the output must be enhance 'cause right now is not so good):
2020-08-08-18-00-08_871x186

The argument pixel_area fail if no value is passed:
2020-08-08-18-03-08_802x204
Same if the value is not a number:
2020-08-08-18-03-48_877x205

This is the extended version of the cli with every operational arguments passed:
2020-08-08-18-06-14_788x218
(if you see a pixel_area change to pixels_area is because in the others screenshots i forgot the 's', i'm sorry)

@TheJoin95 any idea to improve the output? otherwise I try to think up some logs by myself.

@TheJoin95
Copy link
Member

@TheJoin95 any idea to improve the output? otherwise I try to think up some logs by myself.

If any error occur maybe we should specify the right format with an example, like:
To set the area pixels you need to pass a number! e.g. pixels_area=9

Then about the palette we can show which palette are now supported and their alias.
Like a "list of checkbox" instead of saying: aurora selected, polar night selected.

Also because in order to have a custom palette, you can just say: you have selected a custom palette

Also by adding the color library it will be for sure better Schroedinger-Hat/ImageGoNord-cli#8

@TheJoin95 TheJoin95 linked an issue Aug 12, 2020 that may be closed by this pull request
4 tasks
* refactoring cli.py
* remove useless cycles
* add default palette when no palettes are given
* remove whitespace on nord palette set

TODO: resolve whitespace problems on colorset, this may need a new
version of ign core library => see https://github.com/Schrodinger-Hat/ImageGoNord-pip
* in order to prevent wrong palette selection the flag PALETTE_CHANGED
  is update only when a new color_set is add
* remove utility scripts

Close #13
@Wabri Wabri changed the title WIP: Resolve 11 - CLI Resolve 11 - CLI Apr 25, 2021
@Wabri Wabri merged commit ec3c60f into master Apr 25, 2021
@Wabri Wabri deleted the feature/11/cli branch April 25, 2021 08:29
Test file is no longer needed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactoring - Folder structure Creazione CLI utility per convertire immagini
2 participants