summaryrefslogtreecommitdiff
path: root/image_processing/not.py
diff options
context:
space:
mode:
authorFabián Montero <fabian@cluster451.org>2022-11-17 00:06:29 -0600
committerFabián Montero <fabian@cluster451.org>2022-11-17 00:09:35 -0600
commit7f7a9d51c8159f2ca3bea8c26e703093cd4779d7 (patch)
tree14fd03b12449561d46722229cd8f76c2dfc886c4 /image_processing/not.py
parentd3dc246dc0c6bbdfa2253f1696ff7dcc574990b8 (diff)
adds decription and description program
Diffstat (limited to 'image_processing/not.py')
-rw-r--r--image_processing/not.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/image_processing/not.py b/image_processing/not.py
new file mode 100644
index 0000000..be43e9f
--- /dev/null
+++ b/image_processing/not.py
@@ -0,0 +1,23 @@
+import sys
+import math
+from itertools import cycle
+
+source, target = sys.argv[1:]
+
+target = open(target,"ab")
+
+with open(source, 'rb') as source:
+ image_bytes = source.read()
+ i = 0
+ x = 0
+ for n in image_bytes:
+ if not (i == 3):
+ x = n ^ 0b11111111
+ i += 1
+ else:
+ x = n
+ i = 0
+
+ target.write(bytes([x]))
+
+target.close()