From e37961483b30d2894251061219ce316eb57bccb4 Mon Sep 17 00:00:00 2001 From: Jagdamba Tripathi <54079135+jagdtri2003@users.noreply.github.com> Date: Sun, 16 Oct 2022 01:18:39 +0530 Subject: [PATCH 1/2] Create convert2jpg.py --- scripts/Convert-to-jpg/convert2jpg.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 scripts/Convert-to-jpg/convert2jpg.py diff --git a/scripts/Convert-to-jpg/convert2jpg.py b/scripts/Convert-to-jpg/convert2jpg.py new file mode 100644 index 0000000..a09a316 --- /dev/null +++ b/scripts/Convert-to-jpg/convert2jpg.py @@ -0,0 +1,23 @@ +import os +import sys +from PIL import Image + +if len(sys.argv) > 1: + if os.path.exists(sys.argv[1]): + im = Image.open(sys.argv[1]) + target_name = sys.argv[1] + ".jpg" + rgb_im = im.convert('RGB') + rgb_im.save(target_name) + print("Saved as " + target_name) + else: + print(sys.argv[1] + " not found") +else: + print("Usage: convert2jpg.py ") + + +""" + To run it use: + + convert2jpg test.png + +""" From 1b4dbcbf2a2e74f1c17525982a142640ef78d366 Mon Sep 17 00:00:00 2001 From: Jagdamba Tripathi <54079135+jagdtri2003@users.noreply.github.com> Date: Sun, 16 Oct 2022 08:15:52 +0530 Subject: [PATCH 2/2] Create Design1.py Color Changing Pattern using Turtle --- scripts/Turtle Graphics/Design1.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 scripts/Turtle Graphics/Design1.py diff --git a/scripts/Turtle Graphics/Design1.py b/scripts/Turtle Graphics/Design1.py new file mode 100644 index 0000000..17aa89b --- /dev/null +++ b/scripts/Turtle Graphics/Design1.py @@ -0,0 +1,21 @@ +import turtle as t + +t.bgcolor("black") +t.speed(0) +t.pensize(2) + +colors=['red','yellow','blue','purple','green','#fe019a','black','white','red','yellow','blue','purple','green','#fe019a','black','white'] + +distance=170 +t.hideturtle() + +for color in colors: + t.color(color) + for j in range(8): + t.left(45) + for i in range (2): + t.forward(distance) + t.left(60) + t.forward(distance) + t.left(120) +t.done()