PY SIC
1.0.0

영어 | 简体中文
PY-SIC은 "파이썬을위한 간단한 이미지 변환기"를 나타냅니다. 인기있는 Python 이미징 라이브러리 베개의 간단한 래퍼로 볼 수 있지만 @egocarib에서 제공하는 해결 방법 덕분에 더 나은 GIF 변환 품질을위한 패치가 들어 있습니다. 이 저장소를 유지 관리한다는 아이디어는 Weibo Emoji라는 다른 저장소에서 스크립트를 리팩토링하는 과정에서 비롯됩니다. 주요 목적은 자동화입니다. 이미지를 변환하고 원본 파일 구조를 수동으로 유지하는 데 시간이 많이 걸렸습니다. 요약하면, PY-SIC은 주로 다음과 같이 도와 드릴 수 있습니다.
코드는 GPL-3.0 라이센스에 따라 라이센스가 부여됩니다.
당신의 관심을 가질 수 있습니까?
2021 년 10 월 17 일까지 모든 것이 Pycharm 2021.2.2 + Python 3.10.0으로 잘 보입니다. Visual Studio Code를 사용할 수 있지만 일부 스크립트에서 가져 오기 동작을 조정하여 올바르게 실행하도록해야 할 수도 있습니다.
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 )유용하다는 것을 알기를 바랍니다! ?