sticker-convert 2.7.8__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.
Files changed (110) hide show
  1. {sticker-convert-2.7.8/src/sticker_convert.egg-info → sticker-convert-2.7.9}/PKG-INFO +19 -13
  2. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/README.md +17 -12
  3. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/requirements.txt +1 -0
  4. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert/cli.py +4 -0
  5. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert/converter.py +22 -4
  6. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert/gui.py +12 -2
  7. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert/gui_components/frames/comp_frame.py +27 -67
  8. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert/gui_components/windows/advanced_compression_window.py +83 -148
  9. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert/job.py +9 -0
  10. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert/job_option.py +4 -0
  11. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert/resources/compression.json +11 -0
  12. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert/resources/help.json +1 -0
  13. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert/version.py +1 -1
  14. {sticker-convert-2.7.8 → sticker-convert-2.7.9/src/sticker_convert.egg-info}/PKG-INFO +19 -13
  15. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert.egg-info/requires.txt +1 -0
  16. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/LICENSE +0 -0
  17. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/MANIFEST.in +0 -0
  18. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/pyproject.toml +0 -0
  19. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/setup.cfg +0 -0
  20. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert/__init__.py +0 -0
  21. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert/__main__.py +0 -0
  22. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert/definitions.py +0 -0
  23. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert/downloaders/__init__.py +0 -0
  24. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert/downloaders/download_base.py +0 -0
  25. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert/downloaders/download_kakao.py +0 -0
  26. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert/downloaders/download_line.py +0 -0
  27. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert/downloaders/download_signal.py +0 -0
  28. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert/downloaders/download_telegram.py +0 -0
  29. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert/gui_components/__init__.py +0 -0
  30. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert/gui_components/frames/__init__.py +0 -0
  31. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert/gui_components/frames/config_frame.py +0 -0
  32. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert/gui_components/frames/control_frame.py +0 -0
  33. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert/gui_components/frames/cred_frame.py +0 -0
  34. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert/gui_components/frames/input_frame.py +0 -0
  35. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert/gui_components/frames/output_frame.py +0 -0
  36. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert/gui_components/frames/progress_frame.py +0 -0
  37. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert/gui_components/frames/right_clicker.py +0 -0
  38. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert/gui_components/gui_utils.py +0 -0
  39. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert/gui_components/windows/__init__.py +0 -0
  40. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert/gui_components/windows/base_window.py +0 -0
  41. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert/gui_components/windows/kakao_get_auth_window.py +0 -0
  42. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert/gui_components/windows/line_get_auth_window.py +0 -0
  43. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert/gui_components/windows/signal_get_auth_window.py +0 -0
  44. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert/ios-message-stickers-template/.github/FUNDING.yml +0 -0
  45. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert/ios-message-stickers-template/.gitignore +0 -0
  46. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert/ios-message-stickers-template/README.md +0 -0
  47. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert/ios-message-stickers-template/stickers/Info.plist +0 -0
  48. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Info.plist +0 -0
  49. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/Contents.json +0 -0
  50. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/Sticker Pack.stickerpack/Contents.json +0 -0
  51. {sticker-convert-2.7.8 → 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
  52. {sticker-convert-2.7.8 → 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
  53. {sticker-convert-2.7.8 → 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
  54. {sticker-convert-2.7.8 → 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
  55. {sticker-convert-2.7.8 → 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
  56. {sticker-convert-2.7.8 → 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
  57. {sticker-convert-2.7.8 → 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
  58. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/iMessage App Icon.stickersiconset/Contents.json +0 -0
  59. {sticker-convert-2.7.8 → 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
  60. {sticker-convert-2.7.8 → 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
  61. {sticker-convert-2.7.8 → 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
  62. {sticker-convert-2.7.8 → 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
  63. {sticker-convert-2.7.8 → 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
  64. {sticker-convert-2.7.8 → 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
  65. {sticker-convert-2.7.8 → 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
  66. {sticker-convert-2.7.8 → 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
  67. {sticker-convert-2.7.8 → 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
  68. {sticker-convert-2.7.8 → 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
  69. {sticker-convert-2.7.8 → 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
  70. {sticker-convert-2.7.8 → 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
  71. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert/ios-message-stickers-template/stickers.xcodeproj/project.pbxproj +0 -0
  72. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert/ios-message-stickers-template/stickers.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -0
  73. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert/ios-message-stickers-template/stickers.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -0
  74. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert/ios-message-stickers-template/stickers.xcodeproj/project.xcworkspace/xcuserdata/niklaspeterson.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  75. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert/ios-message-stickers-template/stickers.xcodeproj/xcuserdata/niklaspeterson.xcuserdatad/xcschemes/xcschememanagement.plist +0 -0
  76. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert/resources/NotoColorEmoji.ttf +0 -0
  77. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert/resources/appicon.icns +0 -0
  78. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert/resources/appicon.ico +0 -0
  79. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert/resources/appicon.png +0 -0
  80. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert/resources/emoji.json +0 -0
  81. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert/resources/input.json +0 -0
  82. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert/resources/output.json +0 -0
  83. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert/uploaders/__init__.py +0 -0
  84. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert/uploaders/compress_wastickers.py +0 -0
  85. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert/uploaders/upload_base.py +0 -0
  86. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert/uploaders/upload_signal.py +0 -0
  87. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert/uploaders/upload_telegram.py +0 -0
  88. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert/uploaders/xcode_imessage.py +0 -0
  89. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert/utils/auth/get_kakao_auth.py +0 -0
  90. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert/utils/auth/get_line_auth.py +0 -0
  91. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert/utils/auth/get_signal_auth.py +0 -0
  92. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert/utils/callback.py +0 -0
  93. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert/utils/files/cache_store.py +0 -0
  94. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert/utils/files/json_manager.py +0 -0
  95. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert/utils/files/json_resources_loader.py +0 -0
  96. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert/utils/files/metadata_handler.py +0 -0
  97. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert/utils/files/run_bin.py +0 -0
  98. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert/utils/files/sanitize_filename.py +0 -0
  99. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert/utils/media/apple_png_normalize.py +0 -0
  100. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert/utils/media/codec_info.py +0 -0
  101. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert/utils/media/decrypt_kakao.py +0 -0
  102. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert/utils/media/format_verify.py +0 -0
  103. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert/utils/url_detect.py +0 -0
  104. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert.egg-info/SOURCES.txt +0 -0
  105. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert.egg-info/dependency_links.txt +0 -0
  106. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert.egg-info/entry_points.txt +0 -0
  107. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/src/sticker_convert.egg-info/top_level.txt +0 -0
  108. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/tests/test_compression.py +0 -0
  109. {sticker-convert-2.7.8 → sticker-convert-2.7.9}/tests/test_download.py +0 -0
  110. {sticker-convert-2.7.8 → 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.8
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>
@@ -372,6 +372,7 @@ 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
377
  Requires-Dist: Pillow==10.1.0
377
378
  Requires-Dist: pyoxipng~=9.0.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] [--vid-size-max VID_SIZE_MAX]
489
- [--img-size-max IMG_SIZE_MAX] [--vid-format VID_FORMAT] [--img-format IMG_FORMAT] [--fake-vid]
490
- [--scale-filter SCALE_FILTER] [--quantize-method QUANTIZE_METHOD] [--cache-dir CACHE_DIR]
491
- [--default-emoji DEFAULT_EMOJI] [--signal-uuid SIGNAL_UUID] [--signal-password SIGNAL_PASSWORD]
492
- [--signal-get-auth] [--signal-data-dir SIGNAL_DATA_DIR] [--telegram-token TELEGRAM_TOKEN]
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-get-auth] [--line-cookies LINE_COOKIES] [--save-cred SAVE_CRED]
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
@@ -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] [--vid-size-max VID_SIZE_MAX]
103
- [--img-size-max IMG_SIZE_MAX] [--vid-format VID_FORMAT] [--img-format IMG_FORMAT] [--fake-vid]
104
- [--scale-filter SCALE_FILTER] [--quantize-method QUANTIZE_METHOD] [--cache-dir CACHE_DIR]
105
- [--default-emoji DEFAULT_EMOJI] [--signal-uuid SIGNAL_UUID] [--signal-password SIGNAL_PASSWORD]
106
- [--signal-get-auth] [--signal-data-dir SIGNAL_DATA_DIR] [--telegram-token TELEGRAM_TOKEN]
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-get-auth] [--line-cookies LINE_COOKIES] [--save-cred SAVE_CRED]
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
@@ -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
@@ -6,6 +6,7 @@ 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
11
  Pillow==10.1.0
11
12
  pyoxipng~=9.0.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,
@@ -526,6 +526,26 @@ class StickerConvert:
526
526
  else:
527
527
  resample = Image.BICUBIC
528
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)
548
+
529
549
  for frame in frames_in:
530
550
  with Image.fromarray(frame, "RGBA") as im: # type: ignore
531
551
  width, height = im.size
@@ -543,10 +563,8 @@ class StickerConvert:
543
563
  width_new = width * self.res_h // height
544
564
 
545
565
  with im.resize((width_new, height_new), resample=resample) as im_resized:
546
- with Image.new(
547
- "RGBA", (self.res_w, self.res_h), (0, 0, 0, 0)
548
- ) as im_new:
549
- im_new.paste(
566
+ with Image.new("RGBA", (self.res_w, self.res_h), bg) as im_new:
567
+ im_new.alpha_composite(
550
568
  im_resized,
551
569
  ((self.res_w - width_new) // 2, (self.res_h - height_new) // 2),
552
570
  )
@@ -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 = self.get_opt_comp().to_dict()
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"] = comp_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.fps_min_var.set(self.gui.compression_presets[selection]["fps"]["min"])
114
- self.gui.fps_max_var.set(self.gui.compression_presets[selection]["fps"]["max"])
115
- self.gui.fps_power_var.set(
116
- self.gui.compression_presets[selection]["fps"]["power"]
117
- )
118
- self.gui.res_w_min_var.set(
119
- self.gui.compression_presets[selection]["res"]["w"]["min"]
120
- )
121
- self.gui.res_w_max_var.set(
122
- self.gui.compression_presets[selection]["res"]["w"]["max"]
123
- )
124
- self.gui.res_h_min_var.set(
125
- self.gui.compression_presets[selection]["res"]["h"]["min"]
126
- )
127
- self.gui.res_h_max_var.set(
128
- self.gui.compression_presets[selection]["res"]["h"]["max"]
129
- )
130
- self.gui.res_power_var.set(
131
- self.gui.compression_presets[selection]["res"]["power"]
132
- )
133
- self.gui.quality_min_var.set(
134
- self.gui.compression_presets[selection]["quality"]["min"]
135
- )
136
- self.gui.quality_max_var.set(
137
- self.gui.compression_presets[selection]["quality"]["max"]
138
- )
139
- self.gui.quality_power_var.set(
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()