summaryrefslogtreecommitdiff
path: root/OASIS/docs/convert.py
diff options
context:
space:
mode:
Diffstat (limited to 'OASIS/docs/convert.py')
-rw-r--r--OASIS/docs/convert.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/OASIS/docs/convert.py b/OASIS/docs/convert.py
new file mode 100644
index 0000000..a210088
--- /dev/null
+++ b/OASIS/docs/convert.py
@@ -0,0 +1,18 @@
+import subprocess
+import os
+
+# path to the folder containing the images
+folder_path = "/mnt/c/Users/eric/Desktop/FSEG/DPOS/"
+
+# loop through all files in the folder
+for filename in os.listdir(folder_path):
+ # check if the file is a .gif image
+ # construct the full path to the image file
+ image_path = os.path.join(folder_path, filename)
+
+ # construct the new file name, replacing .gif with .jpg
+ new_filename = os.path.splitext(filename)[0] + ".jpg"
+ new_image_path = os.path.join(folder_path, new_filename)
+
+ # call the convert command from ImageMagick
+ subprocess.run(["convert", image_path, new_image_path])