Skip to content

added a simple python script for converting JPG image into PNG #436

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions JPG_to_PNG.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from PIL import Image

# open JPG image

try :

image = Image.open(r"C:\Users\ABHILASH\OneDrive\Desktop\iron man_jpg.jpeg") # Repalce path with our own image path

# You can also provide an absolute path if you want to save it elsewhere
image.save("iron man.png") # image is saved in the same dir

except Exception as e :

print(f" Error occurred: {e}")