sticker-convert 2.7.7__tar.gz → 2.7.9__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {sticker-convert-2.7.7/src/sticker_convert.egg-info → sticker-convert-2.7.9}/PKG-INFO +22 -16
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/README.md +18 -13
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/requirements.txt +3 -2
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/cli.py +4 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/converter.py +90 -37
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/gui.py +12 -2
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/gui_components/frames/comp_frame.py +27 -67
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/gui_components/windows/advanced_compression_window.py +83 -148
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/job.py +12 -4
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/job_option.py +4 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/resources/compression.json +22 -11
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/resources/help.json +2 -1
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/utils/media/codec_info.py +8 -8
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/version.py +1 -1
- {sticker-convert-2.7.7 → sticker-convert-2.7.9/src/sticker_convert.egg-info}/PKG-INFO +22 -16
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert.egg-info/requires.txt +3 -2
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/LICENSE +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/MANIFEST.in +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/pyproject.toml +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/setup.cfg +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/__init__.py +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/__main__.py +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/definitions.py +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/downloaders/__init__.py +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/downloaders/download_base.py +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/downloaders/download_kakao.py +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/downloaders/download_line.py +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/downloaders/download_signal.py +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/downloaders/download_telegram.py +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/gui_components/__init__.py +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/gui_components/frames/__init__.py +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/gui_components/frames/config_frame.py +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/gui_components/frames/control_frame.py +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/gui_components/frames/cred_frame.py +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/gui_components/frames/input_frame.py +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/gui_components/frames/output_frame.py +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/gui_components/frames/progress_frame.py +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/gui_components/frames/right_clicker.py +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/gui_components/gui_utils.py +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/gui_components/windows/__init__.py +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/gui_components/windows/base_window.py +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/gui_components/windows/kakao_get_auth_window.py +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/gui_components/windows/line_get_auth_window.py +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/gui_components/windows/signal_get_auth_window.py +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/ios-message-stickers-template/.github/FUNDING.yml +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/ios-message-stickers-template/.gitignore +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/ios-message-stickers-template/README.md +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/ios-message-stickers-template/stickers/Info.plist +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Info.plist +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/Contents.json +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/Sticker Pack.stickerpack/Contents.json +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/Sticker Pack.stickerpack/Sticker 1.sticker/Contents.json +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/Sticker Pack.stickerpack/Sticker 1.sticker/Sticker 1.png +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/Sticker Pack.stickerpack/Sticker 2.sticker/Contents.json +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/Sticker Pack.stickerpack/Sticker 2.sticker/Sticker 2.png +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/Sticker Pack.stickerpack/Sticker 3.sticker/Contents.json +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/Sticker Pack.stickerpack/Sticker 3.sticker/Sticker 3.png +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/iMessage App Icon.stickersiconset/App-Store-1024x1024pt.png +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/iMessage App Icon.stickersiconset/Contents.json +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/iMessage App Icon.stickersiconset/Messages-App-Store-1024x768pt.png +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/iMessage App Icon.stickersiconset/Messages-iPad-67x50pt@2x.png +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/iMessage App Icon.stickersiconset/Messages-iPad-Pro-74x55pt@2x.png +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/iMessage App Icon.stickersiconset/Messages-iPhone-60x45pt@2x.png +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/iMessage App Icon.stickersiconset/Messages-iPhone-60x45pt@3x.png +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/iMessage App Icon.stickersiconset/Messages27x20pt@2x.png +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/iMessage App Icon.stickersiconset/Messages27x20pt@3x.png +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/iMessage App Icon.stickersiconset/Messages32x24pt@2x.png +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/iMessage App Icon.stickersiconset/Messages32x24pt@3x.png +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/iMessage App Icon.stickersiconset/iPad-Settings-29pt@2x.png +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/iMessage App Icon.stickersiconset/iPhone-Settings-29pt@3x.png +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/iMessage App Icon.stickersiconset/iPhone-settings-29pt@2x.png +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/ios-message-stickers-template/stickers.xcodeproj/project.pbxproj +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/ios-message-stickers-template/stickers.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/ios-message-stickers-template/stickers.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/ios-message-stickers-template/stickers.xcodeproj/project.xcworkspace/xcuserdata/niklaspeterson.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/ios-message-stickers-template/stickers.xcodeproj/xcuserdata/niklaspeterson.xcuserdatad/xcschemes/xcschememanagement.plist +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/resources/NotoColorEmoji.ttf +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/resources/appicon.icns +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/resources/appicon.ico +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/resources/appicon.png +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/resources/emoji.json +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/resources/input.json +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/resources/output.json +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/uploaders/__init__.py +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/uploaders/compress_wastickers.py +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/uploaders/upload_base.py +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/uploaders/upload_signal.py +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/uploaders/upload_telegram.py +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/uploaders/xcode_imessage.py +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/utils/auth/get_kakao_auth.py +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/utils/auth/get_line_auth.py +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/utils/auth/get_signal_auth.py +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/utils/callback.py +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/utils/files/cache_store.py +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/utils/files/json_manager.py +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/utils/files/json_resources_loader.py +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/utils/files/metadata_handler.py +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/utils/files/run_bin.py +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/utils/files/sanitize_filename.py +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/utils/media/apple_png_normalize.py +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/utils/media/decrypt_kakao.py +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/utils/media/format_verify.py +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert/utils/url_detect.py +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert.egg-info/SOURCES.txt +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert.egg-info/dependency_links.txt +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert.egg-info/entry_points.txt +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/src/sticker_convert.egg-info/top_level.txt +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/tests/test_compression.py +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/tests/test_download.py +0 -0
- {sticker-convert-2.7.7 → sticker-convert-2.7.9}/tests/test_export.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: sticker-convert
|
3
|
-
Version: 2.7.
|
3
|
+
Version: 2.7.9
|
4
4
|
Summary: Convert (animated) stickers to/from WhatsApp, Telegram, Signal, Line, Kakao, iMessage. Written in Python.
|
5
5
|
Author-email: laggykiller <chaudominic2@gmail.com>
|
6
6
|
Maintainer-email: laggykiller <chaudominic2@gmail.com>
|
@@ -367,13 +367,14 @@ License-File: LICENSE
|
|
367
367
|
Requires-Dist: aiolimiter~=1.1.0
|
368
368
|
Requires-Dist: anyio~=3.7.1
|
369
369
|
Requires-Dist: apngasm_python~=1.2.3
|
370
|
-
Requires-Dist: av~=
|
370
|
+
Requires-Dist: av~=12.0.0
|
371
371
|
Requires-Dist: beautifulsoup4~=4.12.3
|
372
372
|
Requires-Dist: rookiepy~=0.3.6
|
373
373
|
Requires-Dist: imagequant~=1.1.1
|
374
374
|
Requires-Dist: memory-tempfile~=2.2.3
|
375
|
+
Requires-Dist: mergedeep~=1.3.4
|
375
376
|
Requires-Dist: numpy>=1.22.4
|
376
|
-
Requires-Dist: Pillow
|
377
|
+
Requires-Dist: Pillow==10.1.0
|
377
378
|
Requires-Dist: pyoxipng~=9.0.0
|
378
379
|
Requires-Dist: python-telegram-bot~=20.5
|
379
380
|
Requires-Dist: requests~=2.31.0
|
@@ -482,18 +483,19 @@ usage: sticker-convert.py [-h] [--version] [--no-confirm] [--input-dir INPUT_DIR
|
|
482
483
|
[--preset {auto,signal,telegram,telegram_emoji,whatsapp,line,kakao,imessage_small,imessage_medium,imessage_large,custom}]
|
483
484
|
[--steps STEPS] [--processes PROCESSES] [--fps-min FPS_MIN] [--fps-max FPS_MAX]
|
484
485
|
[--fps-power FPS_POWER] [--res-min RES_MIN] [--res-max RES_MAX] [--res-w-min RES_W_MIN]
|
485
|
-
[--res-w-max RES_W_MAX] [--res-h-min RES_H_MIN] [--res-h-max RES_H_MAX] [--res-power RES_POWER]
|
486
|
+
[--res-w-max RES_W_MAX] [--res-h-min RES_H_MIN] [--res-h-max RES_H_MAX] [--res-power RES_POWER]
|
486
487
|
[--quality-min QUALITY_MIN] [--quality-max QUALITY_MAX] [--quality-power QUALITY_POWER]
|
487
488
|
[--color-min COLOR_MIN] [--color-max COLOR_MAX] [--color-power COLOR_POWER]
|
488
|
-
[--duration-min DURATION_MIN] [--duration-max DURATION_MAX] [--
|
489
|
-
[--
|
490
|
-
[--
|
491
|
-
[--
|
492
|
-
[--signal-
|
489
|
+
[--duration-min DURATION_MIN] [--duration-max DURATION_MAX] [--bg-color BG_COLOR]
|
490
|
+
[--vid-size-max VID_SIZE_MAX] [--img-size-max IMG_SIZE_MAX] [--vid-format VID_FORMAT]
|
491
|
+
[--img-format IMG_FORMAT] [--fake-vid] [--scale-filter SCALE_FILTER]
|
492
|
+
[--quantize-method QUANTIZE_METHOD] [--cache-dir CACHE_DIR] [--default-emoji DEFAULT_EMOJI]
|
493
|
+
[--signal-uuid SIGNAL_UUID] [--signal-password SIGNAL_PASSWORD] [--signal-get-auth]
|
494
|
+
[--signal-data-dir SIGNAL_DATA_DIR] [--telegram-token TELEGRAM_TOKEN]
|
493
495
|
[--telegram-userid TELEGRAM_USERID] [--kakao-auth-token KAKAO_AUTH_TOKEN] [--kakao-get-auth]
|
494
496
|
[--kakao-username KAKAO_USERNAME] [--kakao-password KAKAO_PASSWORD]
|
495
|
-
[--kakao-country-code KAKAO_COUNTRY_CODE] [--kakao-phone-number KAKAO_PHONE_NUMBER]
|
496
|
-
[--line-
|
497
|
+
[--kakao-country-code KAKAO_COUNTRY_CODE] [--kakao-phone-number KAKAO_PHONE_NUMBER] [--line-get-auth]
|
498
|
+
[--line-cookies LINE_COOKIES] [--save-cred SAVE_CRED]
|
497
499
|
|
498
500
|
CLI for stickers-convert
|
499
501
|
|
@@ -538,7 +540,7 @@ Output options:
|
|
538
540
|
|
539
541
|
Compression options:
|
540
542
|
--no-compress Do not compress files. Useful for only downloading stickers.
|
541
|
-
--preset {auto,signal,telegram,telegram_emoji,whatsapp,line,kakao,imessage_small,imessage_medium,imessage_large,custom}
|
543
|
+
--preset {auto,signal,telegram,telegram_emoji,whatsapp,line,kakao,imessage_small,imessage_medium,imessage_large,custom}
|
542
544
|
Apply preset for compression.
|
543
545
|
--steps STEPS Set number of divisions between min and max settings.
|
544
546
|
Steps higher = Slower but yields file more closer to the specified file size limit.
|
@@ -579,6 +581,10 @@ Compression options:
|
|
579
581
|
Set minimum output duration in miliseconds.
|
580
582
|
--duration-max DURATION_MAX
|
581
583
|
Set maximum output duration in miliseconds.
|
584
|
+
--bg-color BG_COLOR Set custom background color.
|
585
|
+
Example: 00ff00 for green.
|
586
|
+
If this is not set, background color would be auto set to black if image is bright, or white if image is dark.
|
587
|
+
Note: The color should not be visible if output format supports transparency.
|
582
588
|
--vid-size-max VID_SIZE_MAX
|
583
589
|
Set maximum file size limit for animated stickers.
|
584
590
|
--img-size-max IMG_SIZE_MAX
|
@@ -592,7 +598,7 @@ Compression options:
|
|
592
598
|
(1) Size limit for video is larger than image;
|
593
599
|
(2) Mix image and video into same pack.
|
594
600
|
--scale-filter SCALE_FILTER
|
595
|
-
Set scale filter. Default as
|
601
|
+
Set scale filter. Default as bicubic. Valid options are:
|
596
602
|
- nearest = Use nearest neighbour (Suitable for pixel art)
|
597
603
|
-box = Similar to nearest, but better downscaling
|
598
604
|
- bilinear = Linear interpolation
|
@@ -622,10 +628,10 @@ Credentials options:
|
|
622
628
|
--telegram-token TELEGRAM_TOKEN
|
623
629
|
Set Telegram token. Required for uploading and downloading Telegram stickers.
|
624
630
|
--telegram-userid TELEGRAM_USERID
|
625
|
-
Set telegram user_id (From real account, not bot account). Required for uploading Telegram stickers.
|
631
|
+
Set telegram user_id (From real account, not bot account). Required for uploading Telegram stickers.
|
626
632
|
--kakao-auth-token KAKAO_AUTH_TOKEN
|
627
|
-
Set Kakao auth_token. Required for downloading animated stickers from https://e.kakao.com/t/xxxxx
|
628
|
-
--kakao-get-auth Generate Kakao auth_token. Kakao username, password, country code and phone number are also required.
|
633
|
+
Set Kakao auth_token. Required for downloading animated stickers from https://e.kakao.com/t/xxxxx
|
634
|
+
--kakao-get-auth Generate Kakao auth_token. Kakao username, password, country code and phone number are also required.
|
629
635
|
--kakao-username KAKAO_USERNAME
|
630
636
|
Set Kakao username, which is email or phone number used for signing up Kakao account
|
631
637
|
Example: +447700900142
|
@@ -96,18 +96,19 @@ usage: sticker-convert.py [-h] [--version] [--no-confirm] [--input-dir INPUT_DIR
|
|
96
96
|
[--preset {auto,signal,telegram,telegram_emoji,whatsapp,line,kakao,imessage_small,imessage_medium,imessage_large,custom}]
|
97
97
|
[--steps STEPS] [--processes PROCESSES] [--fps-min FPS_MIN] [--fps-max FPS_MAX]
|
98
98
|
[--fps-power FPS_POWER] [--res-min RES_MIN] [--res-max RES_MAX] [--res-w-min RES_W_MIN]
|
99
|
-
[--res-w-max RES_W_MAX] [--res-h-min RES_H_MIN] [--res-h-max RES_H_MAX] [--res-power RES_POWER]
|
99
|
+
[--res-w-max RES_W_MAX] [--res-h-min RES_H_MIN] [--res-h-max RES_H_MAX] [--res-power RES_POWER]
|
100
100
|
[--quality-min QUALITY_MIN] [--quality-max QUALITY_MAX] [--quality-power QUALITY_POWER]
|
101
101
|
[--color-min COLOR_MIN] [--color-max COLOR_MAX] [--color-power COLOR_POWER]
|
102
|
-
[--duration-min DURATION_MIN] [--duration-max DURATION_MAX] [--
|
103
|
-
[--
|
104
|
-
[--
|
105
|
-
[--
|
106
|
-
[--signal-
|
102
|
+
[--duration-min DURATION_MIN] [--duration-max DURATION_MAX] [--bg-color BG_COLOR]
|
103
|
+
[--vid-size-max VID_SIZE_MAX] [--img-size-max IMG_SIZE_MAX] [--vid-format VID_FORMAT]
|
104
|
+
[--img-format IMG_FORMAT] [--fake-vid] [--scale-filter SCALE_FILTER]
|
105
|
+
[--quantize-method QUANTIZE_METHOD] [--cache-dir CACHE_DIR] [--default-emoji DEFAULT_EMOJI]
|
106
|
+
[--signal-uuid SIGNAL_UUID] [--signal-password SIGNAL_PASSWORD] [--signal-get-auth]
|
107
|
+
[--signal-data-dir SIGNAL_DATA_DIR] [--telegram-token TELEGRAM_TOKEN]
|
107
108
|
[--telegram-userid TELEGRAM_USERID] [--kakao-auth-token KAKAO_AUTH_TOKEN] [--kakao-get-auth]
|
108
109
|
[--kakao-username KAKAO_USERNAME] [--kakao-password KAKAO_PASSWORD]
|
109
|
-
[--kakao-country-code KAKAO_COUNTRY_CODE] [--kakao-phone-number KAKAO_PHONE_NUMBER]
|
110
|
-
[--line-
|
110
|
+
[--kakao-country-code KAKAO_COUNTRY_CODE] [--kakao-phone-number KAKAO_PHONE_NUMBER] [--line-get-auth]
|
111
|
+
[--line-cookies LINE_COOKIES] [--save-cred SAVE_CRED]
|
111
112
|
|
112
113
|
CLI for stickers-convert
|
113
114
|
|
@@ -152,7 +153,7 @@ Output options:
|
|
152
153
|
|
153
154
|
Compression options:
|
154
155
|
--no-compress Do not compress files. Useful for only downloading stickers.
|
155
|
-
--preset {auto,signal,telegram,telegram_emoji,whatsapp,line,kakao,imessage_small,imessage_medium,imessage_large,custom}
|
156
|
+
--preset {auto,signal,telegram,telegram_emoji,whatsapp,line,kakao,imessage_small,imessage_medium,imessage_large,custom}
|
156
157
|
Apply preset for compression.
|
157
158
|
--steps STEPS Set number of divisions between min and max settings.
|
158
159
|
Steps higher = Slower but yields file more closer to the specified file size limit.
|
@@ -193,6 +194,10 @@ Compression options:
|
|
193
194
|
Set minimum output duration in miliseconds.
|
194
195
|
--duration-max DURATION_MAX
|
195
196
|
Set maximum output duration in miliseconds.
|
197
|
+
--bg-color BG_COLOR Set custom background color.
|
198
|
+
Example: 00ff00 for green.
|
199
|
+
If this is not set, background color would be auto set to black if image is bright, or white if image is dark.
|
200
|
+
Note: The color should not be visible if output format supports transparency.
|
196
201
|
--vid-size-max VID_SIZE_MAX
|
197
202
|
Set maximum file size limit for animated stickers.
|
198
203
|
--img-size-max IMG_SIZE_MAX
|
@@ -206,7 +211,7 @@ Compression options:
|
|
206
211
|
(1) Size limit for video is larger than image;
|
207
212
|
(2) Mix image and video into same pack.
|
208
213
|
--scale-filter SCALE_FILTER
|
209
|
-
Set scale filter. Default as
|
214
|
+
Set scale filter. Default as bicubic. Valid options are:
|
210
215
|
- nearest = Use nearest neighbour (Suitable for pixel art)
|
211
216
|
-box = Similar to nearest, but better downscaling
|
212
217
|
- bilinear = Linear interpolation
|
@@ -236,10 +241,10 @@ Credentials options:
|
|
236
241
|
--telegram-token TELEGRAM_TOKEN
|
237
242
|
Set Telegram token. Required for uploading and downloading Telegram stickers.
|
238
243
|
--telegram-userid TELEGRAM_USERID
|
239
|
-
Set telegram user_id (From real account, not bot account). Required for uploading Telegram stickers.
|
244
|
+
Set telegram user_id (From real account, not bot account). Required for uploading Telegram stickers.
|
240
245
|
--kakao-auth-token KAKAO_AUTH_TOKEN
|
241
|
-
Set Kakao auth_token. Required for downloading animated stickers from https://e.kakao.com/t/xxxxx
|
242
|
-
--kakao-get-auth Generate Kakao auth_token. Kakao username, password, country code and phone number are also required.
|
246
|
+
Set Kakao auth_token. Required for downloading animated stickers from https://e.kakao.com/t/xxxxx
|
247
|
+
--kakao-get-auth Generate Kakao auth_token. Kakao username, password, country code and phone number are also required.
|
243
248
|
--kakao-username KAKAO_USERNAME
|
244
249
|
Set Kakao username, which is email or phone number used for signing up Kakao account
|
245
250
|
Example: +447700900142
|
@@ -1,13 +1,14 @@
|
|
1
1
|
aiolimiter~=1.1.0
|
2
2
|
anyio~=3.7.1
|
3
3
|
apngasm_python~=1.2.3
|
4
|
-
av~=
|
4
|
+
av~=12.0.0
|
5
5
|
beautifulsoup4~=4.12.3
|
6
6
|
rookiepy~=0.3.6
|
7
7
|
imagequant~=1.1.1
|
8
8
|
memory-tempfile~=2.2.3
|
9
|
+
mergedeep~=1.3.4
|
9
10
|
numpy>=1.22.4
|
10
|
-
Pillow
|
11
|
+
Pillow==10.1.0
|
11
12
|
pyoxipng~=9.0.0
|
12
13
|
python-telegram-bot~=20.5
|
13
14
|
requests~=2.31.0
|
@@ -114,6 +114,7 @@ class CLI:
|
|
114
114
|
)
|
115
115
|
flags_comp_float = ("fps_power", "res_power", "quality_power", "color_power")
|
116
116
|
flags_comp_str = (
|
117
|
+
"bg_color",
|
117
118
|
"vid_format",
|
118
119
|
"img_format",
|
119
120
|
"cache_dir",
|
@@ -350,6 +351,9 @@ class CLI:
|
|
350
351
|
duration_max=self.compression_presets[preset]["duration"]["max"]
|
351
352
|
if args.duration_max is None
|
352
353
|
else args.duration_max,
|
354
|
+
bg_color=self.compression_presets[preset]["bg_color"]
|
355
|
+
if args.bg_color is None
|
356
|
+
else args.bg_color,
|
353
357
|
steps=self.compression_presets[preset]["steps"]
|
354
358
|
if args.steps is None
|
355
359
|
else args.steps,
|
@@ -6,10 +6,11 @@ from io import BytesIO
|
|
6
6
|
from math import ceil, floor
|
7
7
|
from pathlib import Path
|
8
8
|
from queue import Queue
|
9
|
-
from typing import TYPE_CHECKING, Any, List, Literal, Optional, Tuple, Union, cast
|
9
|
+
from typing import TYPE_CHECKING, Any, Dict, List, Literal, Optional, Tuple, Union, cast
|
10
10
|
|
11
11
|
import numpy as np
|
12
12
|
from PIL import Image
|
13
|
+
from PIL import __version__ as PillowVersion
|
13
14
|
|
14
15
|
from sticker_convert.job_option import CompOption
|
15
16
|
from sticker_convert.utils.callback import Callback, CallbackReturn, CbQueueItemType
|
@@ -378,10 +379,10 @@ class StickerConvert:
|
|
378
379
|
self.frames_raw.append(np.asarray(im.convert("RGBA")))
|
379
380
|
|
380
381
|
def _frames_import_pyav(self) -> None:
|
381
|
-
import av
|
382
|
-
from av.codec.context import CodecContext
|
383
|
-
from av.container.input import InputContainer
|
384
|
-
from av.video.codeccontext import VideoCodecContext
|
382
|
+
import av
|
383
|
+
from av.codec.context import CodecContext
|
384
|
+
from av.container.input import InputContainer
|
385
|
+
from av.video.codeccontext import VideoCodecContext
|
385
386
|
|
386
387
|
# Crashes when handling some webm in yuv420p and convert to rgba
|
387
388
|
# https://github.com/PyAV-Org/PyAV/issues/1166
|
@@ -390,16 +391,17 @@ class StickerConvert:
|
|
390
391
|
file = self.in_f.as_posix()
|
391
392
|
else:
|
392
393
|
file = BytesIO(self.in_f)
|
393
|
-
with av.open(file) as container:
|
394
|
+
with av.open(file) as container:
|
394
395
|
container = cast(InputContainer, container)
|
395
396
|
context = container.streams.video[0].codec_context
|
396
397
|
if context.name == "vp8":
|
397
|
-
context = CodecContext.create("libvpx", "r")
|
398
|
+
context = cast(VideoCodecContext, CodecContext.create("libvpx", "r"))
|
398
399
|
elif context.name == "vp9":
|
399
|
-
context =
|
400
|
-
|
400
|
+
context = cast(
|
401
|
+
VideoCodecContext, CodecContext.create("libvpx-vp9", "r")
|
402
|
+
)
|
401
403
|
|
402
|
-
for packet in container.demux(container.streams.video):
|
404
|
+
for packet in container.demux(container.streams.video):
|
403
405
|
for frame in context.decode(packet):
|
404
406
|
if frame.width % 2 != 0:
|
405
407
|
width = frame.width - 1
|
@@ -410,22 +412,22 @@ class StickerConvert:
|
|
410
412
|
else:
|
411
413
|
height = frame.height
|
412
414
|
if frame.format.name == "yuv420p":
|
413
|
-
rgb_array = frame.to_ndarray(format="rgb24")
|
415
|
+
rgb_array = frame.to_ndarray(format="rgb24")
|
414
416
|
cast("np.ndarray[Any, Any]", rgb_array)
|
415
417
|
rgba_array = np.dstack(
|
416
418
|
(
|
417
419
|
rgb_array,
|
418
420
|
np.zeros(rgb_array.shape[:2], dtype=np.uint8) + 255,
|
419
|
-
)
|
421
|
+
)
|
420
422
|
)
|
421
423
|
else:
|
422
424
|
# yuva420p may cause crash
|
423
425
|
# https://github.com/laggykiller/sticker-convert/issues/114
|
424
|
-
frame = frame.reformat(
|
426
|
+
frame = frame.reformat(
|
425
427
|
width=width,
|
426
428
|
height=height,
|
427
429
|
format="yuva420p",
|
428
|
-
dst_colorspace=1,
|
430
|
+
dst_colorspace=1,
|
429
431
|
)
|
430
432
|
|
431
433
|
# https://stackoverflow.com/questions/72308308/converting-yuv-to-rgb-in-python-coefficients-work-with-array-dont-work-with-n
|
@@ -522,7 +524,27 @@ class StickerConvert:
|
|
522
524
|
elif self.opt_comp.scale_filter == "lanczos":
|
523
525
|
resample = Image.LANCZOS
|
524
526
|
else:
|
525
|
-
resample = Image.
|
527
|
+
resample = Image.BICUBIC
|
528
|
+
|
529
|
+
if not self.opt_comp.bg_color:
|
530
|
+
# Calculate average color of all frames for selecting background color
|
531
|
+
frames_raw_np = np.array(self.frames_raw)
|
532
|
+
s = frames_raw_np.shape
|
533
|
+
colors = frames_raw_np.reshape((-1, s[3])) # type: ignore
|
534
|
+
# Do not count in alpha=0
|
535
|
+
# If alpha > 0, use alpha as weight
|
536
|
+
colors = colors[colors[:, 3] != 0]
|
537
|
+
if colors.shape[0] == 0:
|
538
|
+
bg = (0, 0, 0, 0)
|
539
|
+
else:
|
540
|
+
colors = colors * (colors[3] / 255)
|
541
|
+
if np.mean(colors[:, :3]) < 128:
|
542
|
+
bg = (255, 255, 255, 0)
|
543
|
+
else:
|
544
|
+
bg = (0, 0, 0, 0)
|
545
|
+
else:
|
546
|
+
r, g, b = bytes.fromhex(self.opt_comp.bg_color)
|
547
|
+
bg = (r, g, b, 0)
|
526
548
|
|
527
549
|
for frame in frames_in:
|
528
550
|
with Image.fromarray(frame, "RGBA") as im: # type: ignore
|
@@ -541,10 +563,8 @@ class StickerConvert:
|
|
541
563
|
width_new = width * self.res_h // height
|
542
564
|
|
543
565
|
with im.resize((width_new, height_new), resample=resample) as im_resized:
|
544
|
-
with Image.new(
|
545
|
-
|
546
|
-
) as im_new:
|
547
|
-
im_new.paste(
|
566
|
+
with Image.new("RGBA", (self.res_w, self.res_h), bg) as im_new:
|
567
|
+
im_new.alpha_composite(
|
548
568
|
im_resized,
|
549
569
|
((self.res_w - width_new) // 2, (self.res_h - height_new) // 2),
|
550
570
|
)
|
@@ -615,6 +635,8 @@ class StickerConvert:
|
|
615
635
|
self._frames_export_png()
|
616
636
|
elif self.out_f.suffix == ".webp" and is_animated:
|
617
637
|
self._frames_export_webp()
|
638
|
+
elif self.out_f.suffix == ".gif":
|
639
|
+
self._frames_export_gif()
|
618
640
|
elif self.out_f.suffix in (".webm", ".mp4", ".mkv") or is_animated:
|
619
641
|
self._frames_export_pyav()
|
620
642
|
else:
|
@@ -629,22 +651,17 @@ class StickerConvert:
|
|
629
651
|
)
|
630
652
|
|
631
653
|
def _frames_export_pyav(self) -> None:
|
632
|
-
import av
|
633
|
-
from av.
|
634
|
-
from av.video.stream import VideoStream # type: ignore
|
654
|
+
import av
|
655
|
+
from av.video.stream import VideoStream
|
635
656
|
|
636
|
-
options = {}
|
657
|
+
options: Dict[str, str] = {}
|
637
658
|
|
638
659
|
if isinstance(self.quality, int):
|
639
660
|
# Seems not actually working
|
640
661
|
options["quality"] = str(self.quality)
|
641
662
|
options["lossless"] = "0"
|
642
663
|
|
643
|
-
if self.out_f.suffix
|
644
|
-
codec = "gif"
|
645
|
-
pixel_format = "rgb8"
|
646
|
-
options["loop"] = "0"
|
647
|
-
elif self.out_f.suffix in (".apng", ".png"):
|
664
|
+
if self.out_f.suffix in (".apng", ".png"):
|
648
665
|
codec = "apng"
|
649
666
|
pixel_format = "rgba"
|
650
667
|
options["plays"] = "0"
|
@@ -657,11 +674,10 @@ class StickerConvert:
|
|
657
674
|
pixel_format = "yuv420p"
|
658
675
|
options["loop"] = "0"
|
659
676
|
|
660
|
-
with av.open(
|
677
|
+
with av.open(
|
661
678
|
self.tmp_f, "w", format=self.out_f.suffix.replace(".", "")
|
662
679
|
) as output:
|
663
|
-
|
664
|
-
out_stream = output.add_stream(codec, rate=self.fps, options=options) # type: ignore
|
680
|
+
out_stream = output.add_stream(codec, rate=self.fps, options=options)
|
665
681
|
out_stream = cast(VideoStream, out_stream)
|
666
682
|
assert isinstance(self.res_w, int) and isinstance(self.res_h, int)
|
667
683
|
out_stream.width = self.res_w
|
@@ -669,12 +685,49 @@ class StickerConvert:
|
|
669
685
|
out_stream.pix_fmt = pixel_format
|
670
686
|
|
671
687
|
for frame in self.frames_processed:
|
672
|
-
av_frame = av.VideoFrame.from_ndarray(frame, format="rgba")
|
673
|
-
|
674
|
-
|
675
|
-
|
676
|
-
|
677
|
-
|
688
|
+
av_frame = av.VideoFrame.from_ndarray(frame, format="rgba")
|
689
|
+
output.mux(out_stream.encode(av_frame))
|
690
|
+
output.mux(out_stream.encode())
|
691
|
+
|
692
|
+
def _frames_export_gif(self) -> None:
|
693
|
+
extra_kwargs: Dict[str, Any] = {}
|
694
|
+
|
695
|
+
# disposal=2 on gif cause flicker in image with transparency
|
696
|
+
# Occurs in Pillow == 10.2.0
|
697
|
+
# https://github.com/python-pillow/Pillow/issues/7787
|
698
|
+
if PillowVersion == "10.2.0":
|
699
|
+
extra_kwargs["optimize"] = False
|
700
|
+
else:
|
701
|
+
extra_kwargs["optimize"] = True
|
702
|
+
|
703
|
+
# Only enable transparency if all pixels have alpha channel
|
704
|
+
# with value of 0 or 255
|
705
|
+
alpha_channel_values = np.unique(np.array(self.frames_raw)[:, :, :, 3])
|
706
|
+
illegals = np.setxor1d(
|
707
|
+
alpha_channel_values, [0, 255]
|
708
|
+
) # Find all values not 0 or 255
|
709
|
+
if illegals.size == 0:
|
710
|
+
extra_kwargs["transparency"] = 0
|
711
|
+
extra_kwargs["disposal"] = 2
|
712
|
+
im_out = [self.quantize(Image.fromarray(i)) for i in self.frames_processed]
|
713
|
+
else:
|
714
|
+
im_out = [
|
715
|
+
self.quantize(Image.fromarray(i).convert("RGB")).convert("RGB")
|
716
|
+
for i in self.frames_processed
|
717
|
+
]
|
718
|
+
|
719
|
+
if self.fps:
|
720
|
+
extra_kwargs["save_all"] = True
|
721
|
+
extra_kwargs["append_images"] = im_out[1:]
|
722
|
+
extra_kwargs["duration"] = int(1000 / self.fps)
|
723
|
+
extra_kwargs["loop"] = 0
|
724
|
+
|
725
|
+
im_out[0].save(
|
726
|
+
self.tmp_f,
|
727
|
+
format="GIF",
|
728
|
+
quality=self.quality,
|
729
|
+
**extra_kwargs,
|
730
|
+
)
|
678
731
|
|
679
732
|
def _frames_export_webp(self) -> None:
|
680
733
|
import webp # type: ignore
|
@@ -12,6 +12,7 @@ from threading import Thread
|
|
12
12
|
from typing import Any, Callable, Dict, Optional, Union
|
13
13
|
from urllib.parse import urlparse
|
14
14
|
|
15
|
+
from mergedeep import merge # type: ignore
|
15
16
|
from PIL import ImageFont
|
16
17
|
from ttkbootstrap import BooleanVar, DoubleVar, IntVar, StringVar, Toplevel, Window # type: ignore
|
17
18
|
from ttkbootstrap.dialogs import Messagebox, Querybox # type: ignore
|
@@ -127,6 +128,7 @@ class GUI(Window):
|
|
127
128
|
self.img_size_max_var = IntVar(self)
|
128
129
|
self.vid_size_max_var = IntVar(self)
|
129
130
|
self.size_disable_var = BooleanVar()
|
131
|
+
self.bg_color_var = StringVar()
|
130
132
|
self.img_format_var = StringVar(self)
|
131
133
|
self.vid_format_var = StringVar(self)
|
132
134
|
self.fake_vid_var = BooleanVar()
|
@@ -265,7 +267,12 @@ class GUI(Window):
|
|
265
267
|
def save_config(self) -> None:
|
266
268
|
# Only update comp_custom if custom preset is selected
|
267
269
|
if self.comp_preset_var.get() == "custom":
|
268
|
-
comp_custom =
|
270
|
+
comp_custom: Dict[Any, Any] = merge( # type: ignore
|
271
|
+
self.compression_presets.get("custom"), # type: ignore
|
272
|
+
self.get_opt_comp().to_dict(),
|
273
|
+
)
|
274
|
+
comp_custom["format"]["img"] = comp_custom["format"]["img"][0]
|
275
|
+
comp_custom["format"]["vid"] = comp_custom["format"]["vid"][0]
|
269
276
|
del comp_custom["preset"]
|
270
277
|
del comp_custom["no_compress"]
|
271
278
|
else:
|
@@ -332,7 +339,9 @@ class GUI(Window):
|
|
332
339
|
)
|
333
340
|
comp_custom = self.settings.get("comp_custom")
|
334
341
|
if comp_custom:
|
335
|
-
self.compression_presets["custom"] =
|
342
|
+
self.compression_presets["custom"] = merge(
|
343
|
+
self.compression_presets["custom"], comp_custom
|
344
|
+
)
|
336
345
|
self.cache_dir_var.set(self.settings.get("comp", {}).get("cache_dir", ""))
|
337
346
|
self.processes_var.set(
|
338
347
|
self.settings.get("comp", {}).get("processes", ceil(cpu_count() / 2))
|
@@ -509,6 +518,7 @@ class GUI(Window):
|
|
509
518
|
duration_max=self.duration_max_var.get()
|
510
519
|
if not self.duration_disable_var.get()
|
511
520
|
else None,
|
521
|
+
bg_color=self.bg_color_var.get(),
|
512
522
|
steps=self.steps_var.get(),
|
513
523
|
fake_vid=self.fake_vid_var.get(),
|
514
524
|
scale_filter=self.scale_filter_var.get(),
|
@@ -110,73 +110,33 @@ class CompFrame(LabelFrame):
|
|
110
110
|
else:
|
111
111
|
self.gui.no_compress_var.set(False)
|
112
112
|
|
113
|
-
self.gui.
|
114
|
-
self.gui.
|
115
|
-
self.gui.
|
116
|
-
|
117
|
-
)
|
118
|
-
self.gui.
|
119
|
-
|
120
|
-
)
|
121
|
-
self.gui.
|
122
|
-
|
123
|
-
)
|
124
|
-
self.gui.
|
125
|
-
|
126
|
-
)
|
127
|
-
self.gui.
|
128
|
-
|
129
|
-
)
|
130
|
-
self.gui.
|
131
|
-
|
132
|
-
)
|
133
|
-
self.gui.
|
134
|
-
|
135
|
-
)
|
136
|
-
self.gui.
|
137
|
-
|
138
|
-
)
|
139
|
-
self.gui.
|
140
|
-
self.gui.compression_presets[selection]["quality"]["power"]
|
141
|
-
)
|
142
|
-
self.gui.color_min_var.set(
|
143
|
-
self.gui.compression_presets[selection]["color"]["min"]
|
144
|
-
)
|
145
|
-
self.gui.color_max_var.set(
|
146
|
-
self.gui.compression_presets[selection]["color"]["max"]
|
147
|
-
)
|
148
|
-
self.gui.color_power_var.set(
|
149
|
-
self.gui.compression_presets[selection]["color"]["power"]
|
150
|
-
)
|
151
|
-
self.gui.duration_min_var.set(
|
152
|
-
self.gui.compression_presets[selection]["duration"]["min"]
|
153
|
-
)
|
154
|
-
self.gui.duration_max_var.set(
|
155
|
-
self.gui.compression_presets[selection]["duration"]["max"]
|
156
|
-
)
|
157
|
-
self.gui.img_size_max_var.set(
|
158
|
-
self.gui.compression_presets[selection]["size_max"]["img"]
|
159
|
-
)
|
160
|
-
self.gui.vid_size_max_var.set(
|
161
|
-
self.gui.compression_presets[selection]["size_max"]["vid"]
|
162
|
-
)
|
163
|
-
self.gui.img_format_var.set(
|
164
|
-
self.gui.compression_presets[selection]["format"]["img"]
|
165
|
-
)
|
166
|
-
self.gui.vid_format_var.set(
|
167
|
-
self.gui.compression_presets[selection]["format"]["vid"]
|
168
|
-
)
|
169
|
-
self.gui.fake_vid_var.set(self.gui.compression_presets[selection]["fake_vid"])
|
170
|
-
self.gui.scale_filter_var.set(
|
171
|
-
self.gui.compression_presets[selection]["scale_filter"]
|
172
|
-
)
|
173
|
-
self.gui.quantize_method_var.set(
|
174
|
-
self.gui.compression_presets[selection]["quantize_method"]
|
175
|
-
)
|
176
|
-
self.gui.default_emoji_var.set(
|
177
|
-
self.gui.compression_presets[selection]["default_emoji"]
|
178
|
-
)
|
179
|
-
self.gui.steps_var.set(self.gui.compression_presets[selection]["steps"])
|
113
|
+
preset = self.gui.compression_presets[selection]
|
114
|
+
self.gui.fps_min_var.set(preset.get("fps", {}).get("min"))
|
115
|
+
self.gui.fps_max_var.set(preset.get("fps", {}).get("max"))
|
116
|
+
self.gui.fps_power_var.set(preset.get("fps", {}).get("power"))
|
117
|
+
self.gui.res_w_min_var.set(preset.get("res", {}).get("w", {}).get("min"))
|
118
|
+
self.gui.res_w_max_var.set(preset.get("res", {}).get("w", {}).get("max"))
|
119
|
+
self.gui.res_h_min_var.set(preset.get("res", {}).get("h", {}).get("min"))
|
120
|
+
self.gui.res_h_max_var.set(preset.get("res", {}).get("h", {}).get("max"))
|
121
|
+
self.gui.res_power_var.set(preset.get("res", {}).get("power"))
|
122
|
+
self.gui.quality_min_var.set(preset.get("quality", {}).get("min"))
|
123
|
+
self.gui.quality_max_var.set(preset.get("quality", {}).get("max"))
|
124
|
+
self.gui.quality_power_var.set(preset.get("quality", {}).get("power"))
|
125
|
+
self.gui.color_min_var.set(preset.get("color", {}).get("min"))
|
126
|
+
self.gui.color_max_var.set(preset.get("color", {}).get("max"))
|
127
|
+
self.gui.color_power_var.set(preset.get("color", {}).get("power"))
|
128
|
+
self.gui.duration_min_var.set(preset.get("duration", {}).get("min"))
|
129
|
+
self.gui.duration_max_var.set(preset.get("duration", {}).get("max"))
|
130
|
+
self.gui.img_size_max_var.set(preset.get("size_max", {}).get("img"))
|
131
|
+
self.gui.vid_size_max_var.set(preset.get("size_max", {}).get("vid"))
|
132
|
+
self.gui.img_format_var.set(preset.get("format", {}).get("img"))
|
133
|
+
self.gui.vid_format_var.set(preset.get("format", {}).get("vid"))
|
134
|
+
self.gui.bg_color_var.set(preset.get("bg_color"))
|
135
|
+
self.gui.fake_vid_var.set(preset.get("fake_vid"))
|
136
|
+
self.gui.scale_filter_var.set(preset.get("scale_filter"))
|
137
|
+
self.gui.quantize_method_var.set(preset.get("quantize_method"))
|
138
|
+
self.gui.default_emoji_var.set(preset.get("default_emoji"))
|
139
|
+
self.gui.steps_var.set(preset.get("steps"))
|
180
140
|
|
181
141
|
self.cb_no_compress()
|
182
142
|
self.gui.highlight_fields()
|