Python
Welcome to Python.org
Python プログラミング入門
2021-10-20 京都大学、Python の基本を解説した無料の教科書「素晴らしすぎる」「非常にわかりやすくて良い」
Kyoto University: プログラミング演習 Python 2021
Python Gossip
Python言語による実務で使える100+の最適化問題 | opt100
Pythonでこんなことできちゃうんです #Python3 - Qiita
撥開 Python, pip, site-packages 的藍色蜘蛛網 💢
Poetry - Python dependency management and packaging made easy
astral-sh/ruff: An extremely fast Python linter and code formatter, written in Rust.
PyCharm
pythonanywhere
pipenv
Reflex
裁剪圖片
Automatically cropping an image with python/PIL - Stack Overflow
【画像処理】Pillowを使って画像周りの余白削除(トリミング)を自動化してみた!(2) - Qiita
Pythonで画像の余白を削除する(OpenCV編)
opencvでスキャン後の余白カット - kkobayashi_a's blog
code:python
import sys
import os
import glob
from PIL import Image, ImageChops
def main():
args = sys.argv1:
print(args0)
for image in glob.glob(args0 + '/*.jpg'):
print(image)
imageProcess(image)
def imageProcess(file):
img = Image.open(file)
w, h = img.size
box = (w*0.05, 0, w*0.95, h)
img = img.crop(box)
bg = Image.new("RGB", img.size, img.getpixel((0, 0)))
diff = ImageChops.difference(img, bg)
croprange = diff.convert("RGB").getbbox()
crop_img = img.crop(croprange)
filename = os.path.basename(file)
if not os.path.isdir('output'):
os.mkdir("output")
crop_img.save("output/" + filename)
if __name__ == '__main__':
main()
【超初心者向け】コピペで動かして楽しむ Python 環境構築&スクレイピング&機械学習&実用化【SUUMO でお得賃貸物件を探そう!】
程式語言