- GOODIES
- Generator
- Named Tuple
- Modules
- Type Checking
- APPLICATIONS
- Palindrome
- Word Search
- Conway Game
- Coin Flip
- SCHEDULER
- Time
- Multithreading
- Subprocess
- Logging
- PACKAGES
- Clipboard
- Socket
-
Image
- Virtualenv
- Jupyter
- Icecream
- Anytree
- Watchdog
- Itertools
- Pywin32
- Fastapi
- FASTAPI
- Project Structure
- Enable Https
- Unit Testing
- Logging
- Service Wrapper
- Middleware
PYTHON PAGES - LEVEL 2
PNG
Convert jpeg to png, with pillow package.
"""
Python Imaging Library (expansion of PIL) is the de facto
image processing package for Python language
Convert jpg to png
"""
import os, pathlib
from PIL import Image # Look Here
DIR = pathlib.Path(__file__).resolve().parent
os.chdir(DIR)
a = Image.open("files/01.jpg")
a.save("files/02.png") # Look Here
b = Image.open("files/02.png")
print(a.format) # JPEG
print(b.format) # PNG
Questions and answers:
Clink on Option to Answer
1. Python image package
- a) PIL
- b) Image