PY SIC
1.0.0

英語| 简体中文
Py-SICは、「Python用のシンプルな画像コンバーター」の略です。人気のPythonイメージングライブラリ枕のシンプルなラッパーと見なすことができますが、 @egocaribが提供する回避策のおかげで、より良いGIF変換品質のパッチが含まれています。このリポジトリを維持するというアイデアは、Weibo絵文字という名前の別のリポジトリのスクリプトをリファクタリングするプロセスから来ています。主な目的は自動化です。画像を変換して元のファイル構造を手動で保持するのに時間がかかることがわかったためです。要約すると、Py-SICは主にあなたを助けることができます:
コードはGPL-3.0ライセンスに基づいてライセンスされていることに注意してください。
あなたの注意plsを頂けますか?
2021年10月17日までに、Pycharm 2021.2.2 + Python 3.10.0ですべてがよく見えます。 Visual Studioコードを間違いなく使用できますが、一部のスクリプトでインポート動作を調整して正しく実行する必要がある場合があります。
Py-SICはPython 3.6+をサポートし、以下にリストされているパッケージに依存する必要があります。自分でパッケージを構築するには、このプロジェクトのパッケージ要件を参照してください。
| 名前 | バージョン |
|---|---|
| 枕 | ≥8.4.0 |
| TQDM | ≥4.62.2 |
TODO:Py-SICはスーパーアルファリリースにあるため、この部分に大きな変化があります。
pip install py-sic # Use pip3 if required. from pysic . engine import SIC
from pysic . errors import EmptyInputError
from pysic . pillow_gif_patch import ALPHA_THRESHOLD
FAIL = "Fail:"
sic = SIC (
has_pbar = True , # A flag indicating whether to show the progress bar or not.
input_path = "your/path/to/input" # The path to an input image or the directory for locating the input image(s).
)
try :
sic . convert (
alpha_threshold = ALPHA_THRESHOLD , # The threshold for the alpha channel.
has_init_output = False , # A flag indicating if the output directory should be cleaned up first.
has_input_structure = True , # A flag indicating if the file structure of the input directory should be kept.
output_dir = "your/path/to/output" # The output directory for the converted image(s).
to_fmt = to_fmt # The target image format for conversion.
)
except EmptyInputError as empty_input :
print ( FAIL , empty_input )
except FileExistsError as file_exists :
print ( FAIL , file_exists )
except FileNotFoundError as input_not_found :
print ( FAIL , input_not_found )
except ValueError as value :
print ( FAIL , value )あなたがそれが役に立つと思うことを願っています! ?