Skip to content

Commit

Permalink
resolves issue #19 and #18
Browse files Browse the repository at this point in the history
* rotates mask
* takes away spurious 'f' characters in argparse file
  • Loading branch information
abetusk committed Oct 30, 2019
1 parent ebd2ec4 commit 3444f60
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
14 changes: 7 additions & 7 deletions argparams.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,19 +85,19 @@ def parse_args():

def verify_args(args):
# Informational logs
logging.info(f"Interval function: {args['interval_function']}")
logging.info("Interval function: {args['interval_function']}")
if args["interval_function"] in ["threshold", "edges", "file-edges"]:
logging.info(f"Lower threshold: {args['bottom_threshold']}")
logging.info("Lower threshold: {args['bottom_threshold']}")
if args["interval_function"] == "threshold":
logging.info(f"Upper threshold: {args['upper_threshold']}")
logging.info("Upper threshold: {args['upper_threshold']}")
if args["interval_function"] in ["random", "waves"]:
logging.info(f"Characteristic length: {args['clength']}")
logging.info(f"Randomness: {args['randomness']}%")
logging.info("Characteristic length: {args['clength']}")
logging.info("Randomness: {args['randomness']}%")
# Actual validation
if not args["output_image_path"]:
output = f"{util.id_generator()}.png"
output = "{util.id_generator()}.png"
logging.warning(
f"No output path provided, defaulting to {output}")
"No output path provided, defaulting to {output}")
args["output_image_path"] = output
args["interval_function"] = read_interval_function(
args["interval_function"])
Expand Down
3 changes: 1 addition & 2 deletions pixelsort.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ def main(args):
data = input_img.load()

logging.debug("Loading mask...")
mask = Image.open(args["mask"]).convert(
'RGBA').load() if args["mask"] else None
mask = Image.open(args["mask"]).convert('RGBA').rotate(args["angle"], expand=True).load() if args["mask"] else None

logging.debug("Getting pixels...")
pixels = get_pixels(data, mask, input_img.size)
Expand Down

0 comments on commit 3444f60

Please sign in to comment.