Optionally run multiple jobs at once
This commit is contained in:
parent
537ac0075b
commit
8ac70d5a08
|
@ -10,6 +10,7 @@ parser.add_argument('colors', type=int, help='Number of colors to separate into'
|
||||||
parser.add_argument('pallete', type=str, help='Pallete file')
|
parser.add_argument('pallete', type=str, help='Pallete file')
|
||||||
parser.add_argument('output', type=str, help='Output dir to write to')
|
parser.add_argument('output', type=str, help='Output dir to write to')
|
||||||
parser.add_argument('--headless', type=bool, default=False, help='Run script headless')
|
parser.add_argument('--headless', type=bool, default=False, help='Run script headless')
|
||||||
|
parser.add_argument('-j', '--jobs', type=int, default=1, help="Number of jobs to run in parallel")
|
||||||
|
|
||||||
class Separate :
|
class Separate :
|
||||||
input = ''
|
input = ''
|
||||||
|
@ -29,7 +30,7 @@ class Separate :
|
||||||
print(f'File {args.pallete} does not exist')
|
print(f'File {args.pallete} does not exist')
|
||||||
exit(2)
|
exit(2)
|
||||||
|
|
||||||
Posterize(self.input, self.pallete, args.colors, args.output, args.headless)
|
Posterize(self.input, self.pallete, args.colors, args.output, args.headless, args.jobs)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__" :
|
if __name__ == "__main__" :
|
||||||
|
|
Loading…
Reference in New Issue