Skip to content

Commit

Permalink
Added negative main
Browse files Browse the repository at this point in the history
  • Loading branch information
l3str4nge committed May 21, 2020
1 parent 41e9e14 commit 45d4bed
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion imgprocalgs/algorithms/dithering.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def _propagate_error(self, x, y, current_error):


def parse_args():
parser = argparse.ArgumentParser(description='Color accent algorithm')
parser = argparse.ArgumentParser(description='Dithering algorithm')
parser.add_argument("--src", type=str, help="Source file path.")
parser.add_argument("--dest", type=str, help="Destination file path.", default='data/')
parser.add_argument("--method", type=str, help="Dithering method")
Expand Down
14 changes: 14 additions & 0 deletions imgprocalgs/algorithms/negative.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import argparse

from imgprocalgs.algorithms.utilities import Image, create_empty_image

OUTPUT_FILENAME = "negative.jpg"
Expand All @@ -14,3 +16,15 @@ def make_negative(image_path: str, dest_path: str):
output_pixels[x, y] = (255 - red, 255 - green, 255 - blue)

output.save(dest_path)


def parse_args():
parser = argparse.ArgumentParser(description='Negative algorithm')
parser.add_argument("--src", type=str, help="Source file path.")
parser.add_argument("--dest", type=str, help="Destination file path.", default='data/')
return parser.parse_args()


def main():
args = parse_args()
make_negative(args.src, args.dest)
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
'imgprocalgs-tiltshift=imgprocalgs.algorithms.tilt_shift:main',
'imgprocalgs-color-accent=imgprocalgs.algorithms.color_acccent:main',
'imgprocalgs-dithering=imgprocalgs.algorithms.dithering:main',
'imgprocalgs-negative=imgprocalgs.algorithms.negative:main',
],
}
)

0 comments on commit 45d4bed

Please sign in to comment.