瀏覽代碼

提测3.6.11(1)去除背景功能

100Years 2 周之前
父節點
當前提交
29805434c5
共有 66 個文件被更改,包括 1472 次插入265 次删除
  1. 1 1
      Podfile
  2. 6 1
      Podfile.lock
  3. 44 4
      TSLiveWallpaper.xcodeproj/project.pbxproj
  4. 22 0
      TSLiveWallpaper/Assets.xcassets/AIList/aiList_RemoveBg.imageset/Contents.json
  5. 二進制
      TSLiveWallpaper/Assets.xcassets/AIList/aiList_RemoveBg.imageset/aiList_RemoveBg@2x.png
  6. 二進制
      TSLiveWallpaper/Assets.xcassets/AIList/aiList_RemoveBg.imageset/aiList_RemoveBg@3x.png
  7. 6 0
      TSLiveWallpaper/Assets.xcassets/AIList/removeBg/Contents.json
  8. 22 0
      TSLiveWallpaper/Assets.xcassets/AIList/removeBg/generate_background.imageset/Contents.json
  9. 二進制
      TSLiveWallpaper/Assets.xcassets/AIList/removeBg/generate_background.imageset/generate_background@2x.png
  10. 二進制
      TSLiveWallpaper/Assets.xcassets/AIList/removeBg/generate_background.imageset/generate_background@3x.png
  11. 21 0
      TSLiveWallpaper/Assets.xcassets/AIList/removeBg/selete_clear.imageset/Contents.json
  12. 二進制
      TSLiveWallpaper/Assets.xcassets/AIList/removeBg/selete_clear.imageset/selete_clear@2x.png
  13. 21 0
      TSLiveWallpaper/Assets.xcassets/AIList/removeBg/selete_color.imageset/Contents.json
  14. 二進制
      TSLiveWallpaper/Assets.xcassets/AIList/removeBg/selete_color.imageset/selete_color@2x.png
  15. 21 0
      TSLiveWallpaper/Assets.xcassets/AIList/removeBg/selete_color_1.imageset/Contents.json
  16. 二進制
      TSLiveWallpaper/Assets.xcassets/AIList/removeBg/selete_color_1.imageset/selete_color_1@2x.png
  17. 21 0
      TSLiveWallpaper/Assets.xcassets/AIList/removeBg/selete_color_2.imageset/Contents.json
  18. 二進制
      TSLiveWallpaper/Assets.xcassets/AIList/removeBg/selete_color_2.imageset/selete_color_2@2x.png
  19. 21 0
      TSLiveWallpaper/Assets.xcassets/AIList/removeBg/selete_color_3.imageset/Contents.json
  20. 二進制
      TSLiveWallpaper/Assets.xcassets/AIList/removeBg/selete_color_3.imageset/selete_color_3@2x.png
  21. 21 0
      TSLiveWallpaper/Assets.xcassets/AIList/removeBg/selete_color_4.imageset/Contents.json
  22. 二進制
      TSLiveWallpaper/Assets.xcassets/AIList/removeBg/selete_color_4.imageset/selete_color_4@2x.png
  23. 21 0
      TSLiveWallpaper/Assets.xcassets/AIList/removeBg/selete_color_5.imageset/Contents.json
  24. 二進制
      TSLiveWallpaper/Assets.xcassets/AIList/removeBg/selete_color_5.imageset/selete_color_5@2x.png
  25. 21 0
      TSLiveWallpaper/Assets.xcassets/AIList/removeBg/selete_image.imageset/Contents.json
  26. 二進制
      TSLiveWallpaper/Assets.xcassets/AIList/removeBg/selete_image.imageset/selete_image@2x.png
  27. 22 0
      TSLiveWallpaper/Assets.xcassets/Common/check_color.imageset/Contents.json
  28. 二進制
      TSLiveWallpaper/Assets.xcassets/Common/check_color.imageset/check_color@2x.png
  29. 二進制
      TSLiveWallpaper/Assets.xcassets/Common/check_color.imageset/check_color@3x.png
  30. 22 0
      TSLiveWallpaper/Assets.xcassets/Common/language_System.imageset/Contents.json
  31. 二進制
      TSLiveWallpaper/Assets.xcassets/Common/language_System.imageset/language_System@2x.png
  32. 二進制
      TSLiveWallpaper/Assets.xcassets/Common/language_System.imageset/language_System@3x.png
  33. 13 1
      TSLiveWallpaper/Business/TSAIListVC/TSAIList+Enmu.swift
  34. 6 0
      TSLiveWallpaper/Business/TSAIListVC/TSAIListHistoryVC/TSAIListHistoryVC.swift
  35. 16 0
      TSLiveWallpaper/Business/TSAIListVC/TSAIListVC/TSAIListVC.swift
  36. 12 0
      TSLiveWallpaper/Business/TSAIListVC/TSAIListVC/VM/TSAIListDataVM+Dic.swift
  37. 17 0
      TSLiveWallpaper/Business/TSAIListVC/TSAIListVC/VM/TSAIListDataVM.swift
  38. 4 2
      TSLiveWallpaper/Business/TSAIListVC/TSAIListVideoPlayerVC/TSAIListVideoPlayerVC.swift
  39. 37 28
      TSLiveWallpaper/Business/TSAIListVC/TSAIPhotoDetailsVC/TSAIPhotoDetailsBrowserCell.swift
  40. 21 5
      TSLiveWallpaper/Business/TSAIListVC/TSAIPhotoDetailsVC/TSAIPhotoDetailsBrowserVC.swift
  41. 84 0
      TSLiveWallpaper/Business/TSAIListVC/TSAIUploadPhotoVC/TSAIPhotoRemoveVC/ImageCompositor.swift
  42. 341 0
      TSLiveWallpaper/Business/TSAIListVC/TSAIUploadPhotoVC/TSAIPhotoRemoveVC/TSAIPhotoRemoveVC.swift
  43. 220 0
      TSLiveWallpaper/Business/TSAIListVC/TSAIUploadPhotoVC/TSAIPhotoRemoveVC/View/TSAIPhotoRemoveBgView.swift
  44. 58 0
      TSLiveWallpaper/Business/TSAIListVC/TSAIUploadPhotoVC/TSAIPhotoRemoveVC/View/TSColorPickerVC.swift
  45. 123 0
      TSLiveWallpaper/Business/TSAIListVC/TSAIUploadPhotoVC/TSAIPhotoRemoveVC/View/TSColorSeleteBarView.swift
  46. 67 0
      TSLiveWallpaper/Business/TSAIListVC/TSAIUploadPhotoVC/TSAIPhotoRemoveVC/View/TSRevokeTool.swift
  47. 20 4
      TSLiveWallpaper/Business/TSMineVC/TSChangeLanguageVC/TSChangeLanguageVC.swift
  48. 29 0
      TSLiveWallpaper/Business/TSTabBarController/TSTabBarController.swift
  49. 4 2
      TSLiveWallpaper/Common/Purchase/TSPurchaseBusiness.swift
  50. 3 3
      TSLiveWallpaper/Common/Purchase/TSPurchaseManager.swift
  51. 7 18
      TSLiveWallpaper/Common/TSNetWork/TSNetWork+Business.swift
  52. 4 0
      TSLiveWallpaper/Common/Tool/LanguageManager.swift
  53. 35 188
      TSLiveWallpaper/Common/ViewTool/TSPhotoPickerManager/TSPhotoPickerManager.swift
  54. 1 2
      TSLiveWallpaper/Data/Model/TSActionInfoModel.swift
  55. 4 6
      TSLiveWallpaper/Data/OperationQueue/TSGenerateBaseOperation/TSGenerateBasePhotoOperation.swift
  56. 3 0
      TSLiveWallpaper/ar.lproj/Localizable.strings
  57. 3 0
      TSLiveWallpaper/de.lproj/Localizable.strings
  58. 3 0
      TSLiveWallpaper/en.lproj/Localizable.strings
  59. 3 0
      TSLiveWallpaper/es.lproj/Localizable.strings
  60. 3 0
      TSLiveWallpaper/fr.lproj/Localizable.strings
  61. 3 0
      TSLiveWallpaper/it.lproj/Localizable.strings
  62. 3 0
      TSLiveWallpaper/ja.lproj/Localizable.strings
  63. 3 0
      TSLiveWallpaper/ko.lproj/Localizable.strings
  64. 3 0
      TSLiveWallpaper/pt-BR.lproj/Localizable.strings
  65. 3 0
      TSLiveWallpaper/pt-PT.lproj/Localizable.strings
  66. 3 0
      TSLiveWallpaper/zh-Hant.lproj/Localizable.strings

+ 1 - 1
Podfile

@@ -32,7 +32,7 @@ target 'TSLiveWallpaper' do
   
   pod "HXPhotoPicker/Picker" #只有选择器
   pod "HXPhotoPicker/Camera/Lite"#不包含定位功能
-  #pod "HXPhotoPicker/Editor" #只有编辑器
+  pod "HXPhotoPicker/Editor" #只有编辑器
 end
 
 

+ 6 - 1
Podfile.lock

@@ -21,6 +21,10 @@ PODS:
     - HXPhotoPicker/Core
   - HXPhotoPicker/Core (5.0.3):
     - HXPhotoPicker/Resources
+  - HXPhotoPicker/Editor (5.0.3):
+    - HXPhotoPicker/EditorView
+  - HXPhotoPicker/EditorView (5.0.3):
+    - HXPhotoPicker/Core
   - HXPhotoPicker/Picker (5.0.3):
     - HXPhotoPicker/Core
   - HXPhotoPicker/Resources (5.0.3)
@@ -79,6 +83,7 @@ DEPENDENCIES:
   - BetterSegmentedControl (~> 2.0)
   - DynamicBlurView
   - HXPhotoPicker/Camera/Lite
+  - HXPhotoPicker/Editor
   - HXPhotoPicker/Picker
   - Kingfisher (= 7.10.0)
   - KingfisherWebP
@@ -159,6 +164,6 @@ SPEC CHECKSUMS:
   TYCyclePagerView: 2b051dade0615c70784aa34f40c646feeddb7344
   TZImagePickerController: d084a7b97c82d387e7669dd86dc9a9057500aacf
 
-PODFILE CHECKSUM: 2f952644185b0f1e1c61383947fd4d148d034d07
+PODFILE CHECKSUM: 06499bee87e2c454ffcd24fb725ea24a695b74fb
 
 COCOAPODS: 1.16.2

+ 44 - 4
TSLiveWallpaper.xcodeproj/project.pbxproj

@@ -128,6 +128,7 @@
 		A87CF8522E0296B30063CB7E /* TSAIPhotoDetailsBrowserVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = A87CF8512E0296960063CB7E /* TSAIPhotoDetailsBrowserVC.swift */; };
 		A87CF8542E029B450063CB7E /* TSAIPhotoDetailsBrowserCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A87CF8532E029B3F0063CB7E /* TSAIPhotoDetailsBrowserCell.swift */; };
 		A87CF85A2E02AF070063CB7E /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = A87CF8582E02AF070063CB7E /* InfoPlist.strings */; };
+		A8884B612E2DE7A3001B41AC /* TSAIPhotoRemoveBgView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8884B602E2DE789001B41AC /* TSAIPhotoRemoveBgView.swift */; };
 		A895B5002E01370E004F9B85 /* TSTextToastView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A895B4FF2E01370E004F9B85 /* TSTextToastView.swift */; };
 		A895B5102E0287F2004F9B85 /* TYPageControl.m in Sources */ = {isa = PBXBuildFile; fileRef = A895B50E2E0287F2004F9B85 /* TYPageControl.m */; };
 		A895B5112E0287F2004F9B85 /* TYCyclePagerView.m in Sources */ = {isa = PBXBuildFile; fileRef = A895B50C2E0287F2004F9B85 /* TYCyclePagerView.m */; };
@@ -157,6 +158,11 @@
 		A8EE92D42DFFFFAD0077DFFD /* TSAIListVM.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8EE92D32DFFFFAA0077DFFD /* TSAIListVM.swift */; };
 		A8EE92D62E0005F70077DFFD /* Pacifico-Regular.ttf in Resources */ = {isa = PBXBuildFile; fileRef = A8EE92D52E0005F70077DFFD /* Pacifico-Regular.ttf */; };
 		A8EE92DB2E00121A0077DFFD /* TSGennerateCellView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8EE92DA2E0012180077DFFD /* TSGennerateCellView.swift */; };
+		A8F3D64D2E2E399600DE6C9D /* TSAIPhotoRemoveVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8F3D64C2E2E399500DE6C9D /* TSAIPhotoRemoveVC.swift */; };
+		A8F3D64F2E2E533400DE6C9D /* TSColorSeleteBarView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8F3D64E2E2E533200DE6C9D /* TSColorSeleteBarView.swift */; };
+		A8F3D6512E2E535700DE6C9D /* TSRevokeTool.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8F3D6502E2E535600DE6C9D /* TSRevokeTool.swift */; };
+		A8F3D6532E2E540C00DE6C9D /* TSColorPickerVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8F3D6522E2E53ED00DE6C9D /* TSColorPickerVC.swift */; };
+		A8F3D6552E2F2F5400DE6C9D /* ImageCompositor.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8F3D6542E2F2F5300DE6C9D /* ImageCompositor.swift */; };
 		A8F76C422D350A9600AA6E93 /* TSPurchaseManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8F76C3E2D350A9600AA6E93 /* TSPurchaseManager.swift */; };
 		A8F76C4D2D3747B400AA6E93 /* TSPurchaseVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8F76C4C2D3747AB00AA6E93 /* TSPurchaseVC.swift */; };
 		A8F778AE2D1AC12400BF55D5 /* TSRandomWallpaperBrowseView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8F778AD2D1AC12100BF55D5 /* TSRandomWallpaperBrowseView.swift */; };
@@ -328,6 +334,7 @@
 		A87CF8592E02AF070063CB7E /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
 		A87CF85C2E02AF150063CB7E /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/InfoPlist.strings; sourceTree = "<group>"; };
 		A87CF85D2E02AF410063CB7E /* ar */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ar; path = ar.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+		A8884B602E2DE789001B41AC /* TSAIPhotoRemoveBgView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TSAIPhotoRemoveBgView.swift; sourceTree = "<group>"; };
 		A895B4FF2E01370E004F9B85 /* TSTextToastView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TSTextToastView.swift; sourceTree = "<group>"; };
 		A895B5012E025020004F9B85 /* ar */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ar; path = ar.lproj/LaunchScreen.strings; sourceTree = "<group>"; };
 		A895B5022E025020004F9B85 /* ar */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ar; path = ar.lproj/Localizable.strings; sourceTree = "<group>"; };
@@ -365,6 +372,11 @@
 		A8EE92D32DFFFFAA0077DFFD /* TSAIListVM.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TSAIListVM.swift; sourceTree = "<group>"; };
 		A8EE92D52E0005F70077DFFD /* Pacifico-Regular.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Pacifico-Regular.ttf"; sourceTree = "<group>"; };
 		A8EE92DA2E0012180077DFFD /* TSGennerateCellView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TSGennerateCellView.swift; sourceTree = "<group>"; };
+		A8F3D64C2E2E399500DE6C9D /* TSAIPhotoRemoveVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TSAIPhotoRemoveVC.swift; sourceTree = "<group>"; };
+		A8F3D64E2E2E533200DE6C9D /* TSColorSeleteBarView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TSColorSeleteBarView.swift; sourceTree = "<group>"; };
+		A8F3D6502E2E535600DE6C9D /* TSRevokeTool.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TSRevokeTool.swift; sourceTree = "<group>"; };
+		A8F3D6522E2E53ED00DE6C9D /* TSColorPickerVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TSColorPickerVC.swift; sourceTree = "<group>"; };
+		A8F3D6542E2F2F5300DE6C9D /* ImageCompositor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImageCompositor.swift; sourceTree = "<group>"; };
 		A8F76C3E2D350A9600AA6E93 /* TSPurchaseManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TSPurchaseManager.swift; sourceTree = "<group>"; };
 		A8F76C4C2D3747AB00AA6E93 /* TSPurchaseVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TSPurchaseVC.swift; sourceTree = "<group>"; };
 		A8F778AD2D1AC12100BF55D5 /* TSRandomWallpaperBrowseView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TSRandomWallpaperBrowseView.swift; sourceTree = "<group>"; };
@@ -974,6 +986,7 @@
 		A86857B62DF9258D0089D222 /* TSAIUploadPhotoVC */ = {
 			isa = PBXGroup;
 			children = (
+				A8F3D64B2E2E398E00DE6C9D /* TSAIPhotoRemoveVC */,
 				A83F28AC2E166378009A4975 /* TSAIRemovePhotlVC */,
 				A8F8BCCD2E03F88700EF4AA6 /* View */,
 				A86857B52DF9258D0089D222 /* TSAIUploadPhotoVC.swift */,
@@ -1014,6 +1027,17 @@
 			path = TSAIPhotoDetailsVC;
 			sourceTree = "<group>";
 		};
+		A8884B5F2E2DE770001B41AC /* View */ = {
+			isa = PBXGroup;
+			children = (
+				A8F3D6522E2E53ED00DE6C9D /* TSColorPickerVC.swift */,
+				A8884B602E2DE789001B41AC /* TSAIPhotoRemoveBgView.swift */,
+				A8F3D6502E2E535600DE6C9D /* TSRevokeTool.swift */,
+				A8F3D64E2E2E533200DE6C9D /* TSColorSeleteBarView.swift */,
+			);
+			path = View;
+			sourceTree = "<group>";
+		};
 		A895B50F2E0287F2004F9B85 /* TYCyclePagerView */ = {
 			isa = PBXGroup;
 			children = (
@@ -1128,6 +1152,16 @@
 			path = View;
 			sourceTree = "<group>";
 		};
+		A8F3D64B2E2E398E00DE6C9D /* TSAIPhotoRemoveVC */ = {
+			isa = PBXGroup;
+			children = (
+				A8F3D6542E2F2F5300DE6C9D /* ImageCompositor.swift */,
+				A8884B5F2E2DE770001B41AC /* View */,
+				A8F3D64C2E2E399500DE6C9D /* TSAIPhotoRemoveVC.swift */,
+			);
+			path = TSAIPhotoRemoveVC;
+			sourceTree = "<group>";
+		};
 		A8F76C3A2D35022300AA6E93 /* TSPurchaseMembershipVC */ = {
 			isa = PBXGroup;
 			children = (
@@ -1377,12 +1411,14 @@
 				A81CA4992D1652C400A3AAC8 /* TSMineVC.swift in Sources */,
 				A8C4C0EF2D27BFF7003C46FC /* TSNetworkTool.swift in Sources */,
 				A828E9432E03AF4E00E6A9EA /* TSAppUpdateManager.swift in Sources */,
+				A8F3D64F2E2E533400DE6C9D /* TSColorSeleteBarView.swift in Sources */,
 				A81CA46E2D156C7000A3AAC8 /* GlobalImports.swift in Sources */,
 				A8FD8F382DFBD660008CAACF /* TSMineTopView.swift in Sources */,
 				A81CA4832D157F5C00A3AAC8 /* UIImageView+Ex.swift in Sources */,
 				A81F5B492D1956EA00740085 /* UIScreen.swift in Sources */,
 				A81E81632E24F05E00207EB8 /* TSFusionImageVC.swift in Sources */,
 				A8EE92CD2DFFF2860077DFFD /* TSBaseOperation.swift in Sources */,
+				A8F3D6512E2E535700DE6C9D /* TSRevokeTool.swift in Sources */,
 				A8F8BCCF2E03F8BC00EF4AA6 /* TSAIUploadPhotoTextView.swift in Sources */,
 				A8EE92CE2DFFF2860077DFFD /* TSGenerateBaseOperation.swift in Sources */,
 				A8EE92CF2DFFF2860077DFFD /* TSGenerateBasePhotoOperation.swift in Sources */,
@@ -1410,6 +1446,8 @@
 				60553FD02D3B54A400BAAD7F /* LWNavigationBar.swift in Sources */,
 				60553FD22D3B54A400BAAD7F /* GradientButton.swift in Sources */,
 				60553FD42D3B54A400BAAD7F /* LWBaseViewController.swift in Sources */,
+				A8F3D6552E2F2F5400DE6C9D /* ImageCompositor.swift in Sources */,
+				A8F3D64D2E2E399600DE6C9D /* TSAIPhotoRemoveVC.swift in Sources */,
 				60553FD62D3B54A400BAAD7F /* SaveSuccessTipsView.swift in Sources */,
 				60553FD72D3B54A400BAAD7F /* GradientText.swift in Sources */,
 				60553FD82D3B54A400BAAD7F /* LWBaseNavigationController.swift in Sources */,
@@ -1451,6 +1489,7 @@
 				A8EE92C22DFFC54C0077DFFD /* TSBootModel.swift in Sources */,
 				A86857B72DF9258D0089D222 /* TSAIUploadPhotoVC.swift in Sources */,
 				A86857822DF81AD40089D222 /* TSActionInfoModel.swift in Sources */,
+				A8884B612E2DE7A3001B41AC /* TSAIPhotoRemoveBgView.swift in Sources */,
 				A86857B22DF921F90089D222 /* TSView.swift in Sources */,
 				A87CF8522E0296B30063CB7E /* TSAIPhotoDetailsBrowserVC.swift in Sources */,
 				A86857872DF81B660089D222 /* TSNetWork+Business.swift in Sources */,
@@ -1520,6 +1559,7 @@
 				A83946432D1D701500ABFF0D /* TSLiveWallpaperCopyrightVC.swift in Sources */,
 				A8F8BCDC2E040D9E00EF4AA6 /* TSBusinessFileManager.swift in Sources */,
 				A8C4C0AB2D2427E7003C46FC /* LivePhotoConverter.swift in Sources */,
+				A8F3D6532E2E540C00DE6C9D /* TSColorPickerVC.swift in Sources */,
 				A81F5B3C2D19087100740085 /* TSRandomWallpaperCell.swift in Sources */,
 				A81F5B442D19559C00740085 /* EditorVideoControlViewCell.swift in Sources */,
 				603901612DFFF0330096551E /* SpacedButton.swift in Sources */,
@@ -1597,7 +1637,7 @@
 				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
 				CODE_SIGN_IDENTITY = "Apple Development";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 3;
+				CURRENT_PROJECT_VERSION = 1;
 				DEVELOPMENT_TEAM = 65UD255J84;
 				ENABLE_APP_SANDBOX = NO;
 				ENABLE_USER_SCRIPT_SANDBOXING = NO;
@@ -1615,7 +1655,7 @@
 					"$(inherited)",
 					"@executable_path/Frameworks",
 				);
-				MARKETING_VERSION = 3.6.10;
+				MARKETING_VERSION = 3.6.11;
 				PRODUCT_BUNDLE_IDENTIFIER = musicplayer.offline.com;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				PROVISIONING_PROFILE_SPECIFIER = "";
@@ -1638,7 +1678,7 @@
 				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
 				CODE_SIGN_IDENTITY = "Apple Development";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 3;
+				CURRENT_PROJECT_VERSION = 1;
 				DEVELOPMENT_TEAM = 65UD255J84;
 				ENABLE_APP_SANDBOX = NO;
 				ENABLE_USER_SCRIPT_SANDBOXING = NO;
@@ -1656,7 +1696,7 @@
 					"$(inherited)",
 					"@executable_path/Frameworks",
 				);
-				MARKETING_VERSION = 3.6.10;
+				MARKETING_VERSION = 3.6.11;
 				PRODUCT_BUNDLE_IDENTIFIER = musicplayer.offline.com;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				PROVISIONING_PROFILE_SPECIFIER = "";

+ 22 - 0
TSLiveWallpaper/Assets.xcassets/AIList/aiList_RemoveBg.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "aiList_RemoveBg@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "filename" : "aiList_RemoveBg@3x.png",
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

二進制
TSLiveWallpaper/Assets.xcassets/AIList/aiList_RemoveBg.imageset/aiList_RemoveBg@2x.png


二進制
TSLiveWallpaper/Assets.xcassets/AIList/aiList_RemoveBg.imageset/aiList_RemoveBg@3x.png


+ 6 - 0
TSLiveWallpaper/Assets.xcassets/AIList/removeBg/Contents.json

@@ -0,0 +1,6 @@
+{
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

+ 22 - 0
TSLiveWallpaper/Assets.xcassets/AIList/removeBg/generate_background.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "generate_background@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "filename" : "generate_background@3x.png",
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

二進制
TSLiveWallpaper/Assets.xcassets/AIList/removeBg/generate_background.imageset/generate_background@2x.png


二進制
TSLiveWallpaper/Assets.xcassets/AIList/removeBg/generate_background.imageset/generate_background@3x.png


+ 21 - 0
TSLiveWallpaper/Assets.xcassets/AIList/removeBg/selete_clear.imageset/Contents.json

@@ -0,0 +1,21 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "selete_clear@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

二進制
TSLiveWallpaper/Assets.xcassets/AIList/removeBg/selete_clear.imageset/selete_clear@2x.png


+ 21 - 0
TSLiveWallpaper/Assets.xcassets/AIList/removeBg/selete_color.imageset/Contents.json

@@ -0,0 +1,21 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "selete_color@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

二進制
TSLiveWallpaper/Assets.xcassets/AIList/removeBg/selete_color.imageset/selete_color@2x.png


+ 21 - 0
TSLiveWallpaper/Assets.xcassets/AIList/removeBg/selete_color_1.imageset/Contents.json

@@ -0,0 +1,21 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "selete_color_1@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

二進制
TSLiveWallpaper/Assets.xcassets/AIList/removeBg/selete_color_1.imageset/selete_color_1@2x.png


+ 21 - 0
TSLiveWallpaper/Assets.xcassets/AIList/removeBg/selete_color_2.imageset/Contents.json

@@ -0,0 +1,21 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "selete_color_2@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

二進制
TSLiveWallpaper/Assets.xcassets/AIList/removeBg/selete_color_2.imageset/selete_color_2@2x.png


+ 21 - 0
TSLiveWallpaper/Assets.xcassets/AIList/removeBg/selete_color_3.imageset/Contents.json

@@ -0,0 +1,21 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "selete_color_3@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

二進制
TSLiveWallpaper/Assets.xcassets/AIList/removeBg/selete_color_3.imageset/selete_color_3@2x.png


+ 21 - 0
TSLiveWallpaper/Assets.xcassets/AIList/removeBg/selete_color_4.imageset/Contents.json

@@ -0,0 +1,21 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "selete_color_4@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

二進制
TSLiveWallpaper/Assets.xcassets/AIList/removeBg/selete_color_4.imageset/selete_color_4@2x.png


+ 21 - 0
TSLiveWallpaper/Assets.xcassets/AIList/removeBg/selete_color_5.imageset/Contents.json

@@ -0,0 +1,21 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "selete_color_5@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

二進制
TSLiveWallpaper/Assets.xcassets/AIList/removeBg/selete_color_5.imageset/selete_color_5@2x.png


+ 21 - 0
TSLiveWallpaper/Assets.xcassets/AIList/removeBg/selete_image.imageset/Contents.json

@@ -0,0 +1,21 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "selete_image@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

二進制
TSLiveWallpaper/Assets.xcassets/AIList/removeBg/selete_image.imageset/selete_image@2x.png


+ 22 - 0
TSLiveWallpaper/Assets.xcassets/Common/check_color.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "check_color@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "filename" : "check_color@3x.png",
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

二進制
TSLiveWallpaper/Assets.xcassets/Common/check_color.imageset/check_color@2x.png


二進制
TSLiveWallpaper/Assets.xcassets/Common/check_color.imageset/check_color@3x.png


+ 22 - 0
TSLiveWallpaper/Assets.xcassets/Common/language_System.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "language_System@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "filename" : "language_System@3x.png",
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

二進制
TSLiveWallpaper/Assets.xcassets/Common/language_System.imageset/language_System@2x.png


二進制
TSLiveWallpaper/Assets.xcassets/Common/language_System.imageset/language_System@3x.png


+ 13 - 1
TSLiveWallpaper/Business/TSAIListVC/TSAIList+Enmu.swift

@@ -12,11 +12,12 @@ enum TSGeneratorImageStyle:String {
     
     case enlighten = "enlighten"   //调整光线
     case recreate = "recreate"   //修复和上色老照片
-    case creatVideo = "creatVideo"   //修复和上色老照片
+    case creatVideo = "creatVideo"   //创造视频
     case remove = "remove"      //删除图片的东西
     case ptp = "ptp"
     
     case portraitFusion = "PortraitFusion"
+    case removeBg = "removeBg"      //删除图片的背景
     
     var imageMaxKb:Int{
         switch self {
@@ -104,6 +105,17 @@ enum TSGeneratorImageStyle:String {
         }
         return 1
     }
+    
+    
+    var vipFreeNumType:VipFreeNumType{
+        if self == .creatVideo {
+            return .generalVideo
+        }else if self == .removeBg {
+            return .generalRemoveBg
+        }else{
+            return .general
+        }
+    }
 }
 
 extension TSGeneratorImageStyle {

+ 6 - 0
TSLiveWallpaper/Business/TSAIListVC/TSAIListHistoryVC/TSAIListHistoryVC.swift

@@ -262,3 +262,9 @@ extension TSAIListHistoryVC{
     }
     
 }
+
+extension TSAIListHistoryVC:TSTabBarControllerProtocol {
+    func tabBarDoubleTap(_ tabbar: UITabBarController){
+        collectionView.setContentOffset(CGPoint(x: 0, y: 0), animated: true)
+    }
+}

+ 16 - 0
TSLiveWallpaper/Business/TSAIListVC/TSAIListVC/TSAIListVC.swift

@@ -187,11 +187,20 @@ extension TSAIListVC {
 //    
     static func clickCell(target:UIViewController,indexPath:IndexPath,itemModel:TSDiscoverItemModel,secModel:TSDiscoverSectionModel) {
         if kShowGenerateBusyView(view: target.view) { return }
+        
+        if itemModel.style == .removeBg {
+            if kPurchaseBusiness.kJudgeVipFreeType(vipFreeNumType: .generalRemoveBg){ return }//判断 vip
+        }
+  
         Self.enterSelectPhotos(target: target,style: itemModel.style) { images in
             if itemModel.style == .remove {
                 target.push(TSAIRemovePhotlVC(titleString: itemModel.name,upLoadImage: images.first!, generatorStyle: itemModel.style,disCoverItemModel: itemModel),animated: false) {
                     closeSelectPhotos()
                 }
+            }else if itemModel.style == .removeBg {
+                target.push(TSAIRemovePhotoBgVC(image: images.first!),animated: false) {
+                    closeSelectPhotos()
+                }
             }else if itemModel.style == .portraitFusion {
                 target.push(TSFusionImageVC(titleString: itemModel.name,upLoadImages: images, generatorStyle: itemModel.style,disCoverItemModel: itemModel),animated: false) {
                     closeSelectPhotos()
@@ -246,3 +255,10 @@ extension TSAIListVC{
         photoPickerManager = nil
     }
 }
+
+
+extension TSAIListVC:TSTabBarControllerProtocol {
+    func tabBarDoubleTap(_ tabbar: UITabBarController){
+        collectionView.setContentOffset(CGPoint(x: 0, y: 0), animated: true)
+    }
+}

+ 12 - 0
TSLiveWallpaper/Business/TSAIListVC/TSAIListVC/VM/TSAIListDataVM+Dic.swift

@@ -102,6 +102,18 @@ extension TSAIListDataVM {
 //MARK: 图生图的模型
 extension TSAIListDataVM {
     
+    var ptp_RemoveBg:[String:Any]{
+        [
+            imageName: "",
+           imageText: "Remove Background",
+           prompt:"Remove Background",
+            specialStyle:1,
+            isVip: true,
+            unionType: 1,
+            model:kie
+        ]
+    }
+    
     var ptp_Remove:[String:Any]{
         [
             imageName: "",

+ 17 - 0
TSLiveWallpaper/Business/TSAIListVC/TSAIListVC/VM/TSAIListDataVM.swift

@@ -178,6 +178,22 @@ class TSAIListDataVM {
         return section
     }()
     
+    lazy var removeBgSection: TSDiscoverSectionModel = {
+        let section = TSDiscoverSectionModel()
+        section.style = .fullCard
+        section.items = [
+            TSDiscoverItemModel(style: .removeBg,
+                                viewModel: TSDiscoverBaseItemVM(
+                                    title: "Remove Background".localized,
+                                    imageNamed: "aiList_RemoveBg".localized,
+                                    info: "Erase image backgrounds with one tap".localized
+                                ),
+                                generateModel: TSGenerateModel(json: ptp_RemoveBg)),
+        ]
+        
+        return section
+    }()
+    
     lazy var listDatas: [TSDiscoverSectionModel] = {
         return [
             videoSection,
@@ -188,6 +204,7 @@ class TSAIListDataVM {
             enhanceSection,
             enlightenSection,
             removeSection,
+            removeBgSection
         ]
     }()
     

+ 4 - 2
TSLiveWallpaper/Business/TSAIListVC/TSAIListVideoPlayerVC/TSAIListVideoPlayerVC.swift

@@ -93,11 +93,13 @@ class TSAIListVideoPlayerVC: UIViewController {
     
     func dealThings() {
         // 监听应用生命周期事件
-        NotificationCenter.default.addObserver(forName: UIApplication.didEnterBackgroundNotification, object: nil, queue: .main) { _ in
+        NotificationCenter.default.addObserver(forName: UIApplication.didEnterBackgroundNotification, object: nil, queue: .main) {[weak self]  _ in
+            guard let self = self else { return }
             self.playPause()
             self.setControlsView(isHidden: false)
         }
-        NotificationCenter.default.addObserver(forName: UIApplication.willEnterForegroundNotification, object: nil, queue: .main) { _ in
+        NotificationCenter.default.addObserver(forName: UIApplication.willEnterForegroundNotification, object: nil, queue: .main) { [weak self] _ in
+            guard let self = self else { return }
             self.playPlay()
             self.setControlsView(isHidden: true)
         }

+ 37 - 28
TSLiveWallpaper/Business/TSAIListVC/TSAIPhotoDetailsVC/TSAIPhotoDetailsBrowserCell.swift

@@ -5,29 +5,19 @@
 //  Created by 100Years on 2025/6/17.
 //
 
-class TSAIPhotoDetailsBrowserCell: TSBaseCollectionCell {
-    var model:TSActionInfoModel = TSActionInfoModel(){
+
+class TSAIPhotoDetailsBaseBrowserCell: TSBaseCollectionCell {
+    var model:TSActionInfoModel = TSActionInfoModel()
+}
+
+class TSAIPhotoDetailsPanComparisonViewCell: TSAIPhotoDetailsBaseBrowserCell {
+    override var model:TSActionInfoModel{
         didSet{
-            removeVideoView()
-            if model.isVideo {
-                panComparisonView.isHidden = true
-                addVideoView()
-            }else if model.isShowSingleImage {
-                netWorkImageView.isHidden = false
-                panComparisonView.isHidden = true
-                netWorkImageView.setAsyncImage(urlString: model.response.resultUrl)
-            }else{
-                panComparisonView.isHidden = false
-                netWorkImageView.isHidden = true
-                uploadPanComparisonView()
-            }
+            uploadPanComparisonView()
         }
     }
     
     lazy var panComparisonView : TSImageIPanComparisonView = TSImageIPanComparisonView()
-    var videoPlayerVC: TSAIListVideoPlayerVC?
-    lazy var netWorkImageView: UIImageView = UIImageView.createImageView()
-    
     override func creatUI() {
         bgContentView.addSubview(panComparisonView)
         panComparisonView.snp.makeConstraints { make in
@@ -35,13 +25,6 @@ class TSAIPhotoDetailsBrowserCell: TSBaseCollectionCell {
             make.leading.trailing.equalTo(0)
             make.centerY.equalToSuperview()
         }
-        
-        netWorkImageView.isHidden = true
-        bgContentView.addSubview(netWorkImageView)
-        netWorkImageView.snp.makeConstraints { make in
-            make.edges.equalToSuperview()
-        }
-        
     }
     
     
@@ -79,8 +62,19 @@ class TSAIPhotoDetailsBrowserCell: TSBaseCollectionCell {
     
 }
 
-
-extension TSAIPhotoDetailsBrowserCell {
+class TSAIPhotoDetailsVideoCell: TSAIPhotoDetailsBaseBrowserCell {
+    override var model:TSActionInfoModel{
+        didSet{
+            removeVideoView()
+            addVideoView()
+        }
+    }
+    
+    var videoPlayerVC: TSAIListVideoPlayerVC?
+    override func creatUI() {
+        
+    }
+    
     func addVideoView(){
         self.videoPlayerVC = TSAIListVideoPlayerVC(videoURL: self.model.response.videoURL)
         self.bgContentView.addSubview(self.videoPlayerVC!.view)
@@ -95,5 +89,20 @@ extension TSAIPhotoDetailsBrowserCell {
     func removeVideoView(){
         videoPlayerVC?.view.removeFromSuperview()
     }
-    
 }
+
+class TSAIPhotoDetailsImageViewCell: TSAIPhotoDetailsBaseBrowserCell {
+    override var model:TSActionInfoModel{
+        didSet{
+            netWorkImageView.setAsyncImage(urlString: model.response.resultUrl)
+        }
+    }
+    lazy var netWorkImageView: UIImageView = UIImageView.createImageView()
+    override func creatUI() {
+        bgContentView.addSubview(netWorkImageView)
+        netWorkImageView.snp.makeConstraints { make in
+            make.edges.equalToSuperview()
+        }
+    }
+}
+

+ 21 - 5
TSLiveWallpaper/Business/TSAIListVC/TSAIPhotoDetailsVC/TSAIPhotoDetailsBrowserVC.swift

@@ -4,7 +4,7 @@
 //
 //  Created by 100Years on 2025/6/17.
 //
-private let cellId = "TSAIPhotoDetailsBrowserCell"
+
 class TSAIPhotoDetailsBrowserVC: TSBaseVC {
     
     var deleteBlock:((TSActionInfoModel)->Void)?
@@ -37,7 +37,11 @@ class TSAIPhotoDetailsBrowserVC: TSBaseVC {
         if #available(iOS 11.0, *) {
             collectionView.contentInsetAdjustmentBehavior = .never
         }
-        collectionView.register(TSAIPhotoDetailsBrowserCell.self, forCellWithReuseIdentifier: cellId)
+        
+        collectionView.register(TSAIPhotoDetailsBaseBrowserCell.self, forCellWithReuseIdentifier: "TSAIPhotoDetailsBaseBrowserCell")
+        collectionView.register(TSAIPhotoDetailsPanComparisonViewCell.self, forCellWithReuseIdentifier: "TSAIPhotoDetailsPanComparisonViewCell")
+        collectionView.register(TSAIPhotoDetailsVideoCell.self, forCellWithReuseIdentifier: "TSAIPhotoDetailsVideoCell")
+        collectionView.register(TSAIPhotoDetailsImageViewCell.self, forCellWithReuseIdentifier: "TSAIPhotoDetailsImageViewCell")
         
         collectionView.isPagingEnabled = true
         collectionView.isHidden = true
@@ -214,6 +218,15 @@ extension TSAIPhotoDetailsBrowserVC {
         guard let currentModel = currentModel else { return }
         kSetBtnVipIcon(btn: saveBtn, show: currentModel.modelType == .normal)
     }
+    
+    func getCellId(model:TSActionInfoModel)->String{
+        if model.isVideo{
+            return "TSAIPhotoDetailsVideoCell"
+        }else if model.isShowSingleImage{
+            return "TSAIPhotoDetailsImageViewCell"
+        }
+        return "TSAIPhotoDetailsPanComparisonViewCell"
+    }
 }
 
 //MARK: UICollectionViewDataSource
@@ -237,11 +250,14 @@ extension TSAIPhotoDetailsBrowserVC:UICollectionViewDataSource,UICollectionViewD
     }
     
     func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
-        let cell = collectionView.dequeueReusableCell(withReuseIdentifier: cellId, for: indexPath) as! TSAIPhotoDetailsBrowserCell
-        if let model = dataModelArray.safeObj(At: indexPath.item){
+     
+        if let model = dataModelArray.safeObj(At: indexPath.item),
+           let cell = collectionView.dequeueReusableCell(withReuseIdentifier: getCellId(model: model), for: indexPath) as? TSAIPhotoDetailsBaseBrowserCell
+        {
             cell.model = model
+            return cell
         }
-        return cell
+        return UICollectionViewCell()
     }
     
 }

+ 84 - 0
TSLiveWallpaper/Business/TSAIListVC/TSAIUploadPhotoVC/TSAIPhotoRemoveVC/ImageCompositor.swift

@@ -0,0 +1,84 @@
+//
+//  ImageCompositor.swift
+//  TSLiveWallpaper
+//
+//  Created by 100Years on 2025/7/21.
+//
+
+
+import UIKit
+
+import UIKit
+
+struct ImageCompositor {
+    
+    /// 合成两个图片为一张图片(线程安全版本)
+    /// - Parameters:
+    ///   - topImage: 顶部图片
+    ///   - bottomImage: 底部图片(可选)
+    ///   - bottomColor: 底部背景色(可选)
+    ///   - bottomGradient: 底部渐变色(可选)
+    ///   - completion: 在主线程返回合成后的UIImage
+    static func compositeImages(topImage: UIImage,
+                               bottomImage: UIImage? = nil,
+                               bottomColor: UIColor? = nil,
+                               bottomGradient: CAGradientLayer? = nil,
+                               completion: @escaping (UIImage?) -> Void) {
+        // 获取顶部图片的分辨率
+        let size = topImage.size
+        let scale = topImage.scale
+        
+        DispatchQueue.global(qos: .userInitiated).async {
+            // 创建图形上下文
+            UIGraphicsBeginImageContextWithOptions(size, false, scale)
+            defer { UIGraphicsEndImageContext() }
+            
+            // 绘制底部背景(按优先级顺序)
+            if let bottomImage = bottomImage {
+                // 1. 使用底部图片
+                bottomImage.draw(in: CGRect(origin: .zero, size: size))
+            } else if let gradient = bottomGradient {
+                // 2. 使用渐变色
+                let fullSizeGradient = CAGradientLayer()
+                fullSizeGradient.colors = gradient.colors
+                fullSizeGradient.locations = gradient.locations
+                fullSizeGradient.startPoint = gradient.startPoint
+                fullSizeGradient.endPoint = gradient.endPoint
+                fullSizeGradient.frame = CGRect(origin: .zero, size: size)
+                
+                if let gradientImage = createImageFrom(layer: fullSizeGradient, size: size) {
+                    gradientImage.draw(in: CGRect(origin: .zero, size: size))
+                } else {
+                    // 渐变生成失败,使用背景色
+                    (bottomColor ?? .clear).setFill()
+                    UIRectFill(CGRect(origin: .zero, size: size))
+                }
+            } else {
+                // 3. 使用纯色
+                (bottomColor ?? .clear).setFill()
+                UIRectFill(CGRect(origin: .zero, size: size))
+            }
+            
+            // 绘制顶部图片
+            topImage.draw(in: CGRect(origin: .zero, size: size))
+            
+            // 获取合成后的图片
+            let composedImage = UIGraphicsGetImageFromCurrentImageContext()
+            
+            DispatchQueue.main.async {
+                completion(composedImage)
+            }
+        }
+    }
+    
+    /// 将CALayer转换为UIImage
+    private static func createImageFrom(layer: CALayer, size: CGSize) -> UIImage? {
+        UIGraphicsBeginImageContextWithOptions(size, false, 0.0)
+        defer { UIGraphicsEndImageContext() }
+        
+        guard let context = UIGraphicsGetCurrentContext() else { return nil }
+        
+        layer.render(in: context)
+        return UIGraphicsGetImageFromCurrentImageContext()
+    }
+}

+ 341 - 0
TSLiveWallpaper/Business/TSAIListVC/TSAIUploadPhotoVC/TSAIPhotoRemoveVC/TSAIPhotoRemoveVC.swift

@@ -0,0 +1,341 @@
+//
+//  TSAIRemovePhotoBgVC.swift
+//  TSLiveWallpaper
+//
+//  Created by 100Years on 2025/7/21.
+//
+import Kingfisher
+class TSAIRemovePhotoBgVC: TSBaseVC {
+    
+
+    var originalImage:UIImage
+    init(image: UIImage) {
+        self.originalImage = image
+        super.init()
+    }
+    
+    @MainActor required init?(coder: NSCoder) {
+        fatalError("init(coder:) has not been implemented")
+    }
+    lazy var photoPickerManager: TSPhotoPickerManager = TSPhotoPickerManager(viewController: self)
+    var isSavePhotoMark:Bool = false
+    var isNeedSavePhoto:Bool {
+        if isSavePhotoMark == false,let _ = infoModel {
+            return true
+        }
+        return false
+    }
+    var infoModel:TSActionInfoModel?{
+        didSet{
+            updateImageView()
+        }
+    }
+    
+    var operation:TSGenerateBaseOperation?
+    var uuidString:String = UUID().uuidString
+    var progressState = TSProgressState.none
+    
+    lazy var shareBtn: TSVerticalButton = {
+        let shareBtn = TSVerticalButton()
+        shareBtn.setUpButton(title: "Share".localized,
+                             image: .share,
+                              font: .font(name:.ZillaSlab,size: 14,weight: .medium),
+                        titleColor: .white.withAlphaComponent(0.8),
+                             autoMirrored: false){ [weak self]  in
+            guard let self = self else { return }
+            clickShare()
+        }
+        shareBtn.contentEdgeInsets = UIEdgeInsets(top: 0, left: 10, bottom: 0, right: 10)
+        shareBtn.titleLabel?.layer.shadowColor = UIColor.black.cgColor
+        shareBtn.titleLabel?.layer.shadowOffset = CGSize(width: 0, height: 2)
+        shareBtn.titleLabel?.layer.shadowRadius = 3
+        shareBtn.titleLabel?.layer.shadowOpacity = 0.4
+        shareBtn.titleLabel?.layer.masksToBounds = false
+        return shareBtn
+    }()
+    lazy var saveBtn: UIButton = {
+        let saveBtn = kCreateNormalSubmitBtn(title: "Save".localized) { [weak self]  in
+            guard let self = self else { return }
+            clickSaveBtn()
+        }
+        kSetBtnVipIcon(btn: saveBtn, show: true)
+        return saveBtn
+    }()
+
+    lazy var removeView: TSAIPhotoRemoveBgView = {
+        let removeView = TSAIPhotoRemoveBgView(targetVC: self)
+        removeView.setFrontImage(image: originalImage)
+        return removeView
+    }()
+    
+    lazy var generateInView : TSGeneratorView = {
+        let generateInView = TSGeneratorView()
+        generateInView.isUploadImage = false
+        generateInView.backgroundColor = .black.withAlphaComponent(0.95)
+        generateInView.animationView.setText(time: String(format: "~ %d mins".localized, 1), info: "Lots of people are processing images right now, so this might take a bit.".localized)
+        generateInView.clickErrorBlock = { [weak self] style in
+            guard let self = self else { return }
+            
+            switch style {
+            case .netWorkError:
+                clickRegenerateBtn()
+            default:
+                self.dismiss(animated: false, completion: nil)
+                break
+            }
+        }
+//        generateInView.clickBackstageBlock = { [weak self]  in
+//            guard let self = self else { return }
+//            clickBackstageBtn()
+//        }
+        generateInView.clickCloseBlock = { [weak self]  in
+            guard let self = self else { return }
+            closePage()
+        }
+        return generateInView
+    }()
+    
+    //重新生成
+    @objc func clickRegenerateBtn(){
+        if kPurchaseBusiness.kJudgeVipFreeType(vipFreeNumType: .generalRemoveBg){ return }//判断 vip
+        generatorOperation()
+    }
+    func updateImageView(){
+        guard let infoModel = self.infoModel else { return }
+        removeView.setFrontImageURLString(urlString: infoModel.response.resultUrl)
+    }
+    
+    func closePage() {
+    
+        if progressState.isResult {
+            if isNeedSavePhoto{
+                TSCustomAlertController.show(in: self, config: TSCustomAlertController.AlertConfig(
+                    message: "You haven't saved the photo yet. Are you sure to quit?".localized,
+                    messageColor: .white,
+                    messageFont: .systemFont(ofSize: 16),
+                    
+                    cancelTitle: "Quit".localized,
+                    cancelColor: .white,
+                    
+                    confirmTitle: "Save".localized,
+                    confirmColor: .themeColor,
+                    
+                    cancelAction: { [weak self]  in
+                        guard let self = self else { return }
+                        print("用户点击了Leave")
+                        cancelDidmiss()
+                    },
+                    confirmAction: { [weak self]  in
+                        guard let self = self else { return }
+                        print("用户点击了Stay")
+                        clickSaveBtn()
+                    }
+                ))
+            }else{
+                cancelDidmiss()
+            }
+        }else{
+            TSCustomAlertController.show(in: self, config: TSCustomAlertController.AlertConfig(
+                message: "As you leave, your task will be interrupted and no result.".localized,
+                messageColor: .white,
+                messageFont: .systemFont(ofSize: 16),
+                
+                cancelTitle: "Leave".localized,
+                cancelColor: .white,
+                
+                confirmTitle: "Wait".localized,
+                confirmColor: .themeColor,
+                
+                cancelAction: { [weak self]  in
+                    guard let self = self else { return }
+                    print("用户点击了Leave")
+                    if let model = infoModel{
+                        TSRMShared.aiListDB.deleteListModel(id: model.id)
+                        NotificationCenter.default.post(name: .kAIPhotoDataChanged, object: nil)
+                    }
+                    cancelDidmiss()
+                },
+                confirmAction: {
+                    print("用户点击了Stay")
+                }
+            ))
+        }
+    }
+
+    func cancelDidmiss(){
+        operation?.cancel()
+        self.dismiss(animated: true, completion: nil)
+    }
+    
+    
+    override func createView() {
+        setPageTitle("Remove Background".localized)
+
+        _ = setNavigationItem("", imageName: "replace_photo", direction: .right, action: #selector(clickNavRight))
+        contentView.addSubview(removeView)
+        removeView.snp.makeConstraints { make in
+            make.edges.equalToSuperview()
+        }
+        
+    
+        let bottomBtnTop:CGFloat = -8-k_Height_safeAreaInsetsBottom()
+        contentView.addSubview(shareBtn)
+        shareBtn.snp.makeConstraints { make in
+            make.leading.equalTo(16)
+            make.width.equalTo(shareBtn.intrinsicContentSize.width)
+            make.height.equalTo(48)
+            make.bottom.equalTo(bottomBtnTop)
+        }
+        
+        contentView.addSubview(saveBtn)
+        saveBtn.snp.makeConstraints { make in
+            make.leading.equalTo(shareBtn.snp.trailing).offset(40)
+            make.trailing.equalTo(-16.0)
+            make.height.equalTo(48)
+            make.bottom.equalTo(bottomBtnTop)
+        }
+        
+        
+        view.addSubview(generateInView)
+        generateInView.snp.makeConstraints { make in
+            make.edges.equalToSuperview()
+        }
+    }
+    
+    override func dealThings() {
+        self.uuidString = UUID().uuidString
+        generatorOperation()
+    }
+    
+    func generatorOperation() {
+        generatorNew()
+    }
+}
+extension TSAIRemovePhotoBgVC {
+    //分享功能
+    @objc func clickShare(){
+        if kJudgeVip(externalBool: true, vc: self){ return }
+        removeView.compositeImages { [weak self]  image in
+            guard let self = self else { return }
+            if let image = image {
+                kShareContent(target: self, anyData: image)
+                guard let infoModel = self.infoModel else { return }
+                
+                if let resultUrl = self.infoModel?.response.resultUrl,
+                   let url = URL(string: resultUrl){
+                    ImageCache.default.store(image, forKey: url.cacheKey)
+                }
+            }
+        }
+    }
+    
+    @objc func clickNavRight() {
+        if kPurchaseBusiness.kJudgeVipFreeType(vipFreeNumType: .generalRemoveBg){ return }//判断 vip
+        photoPickerManager.pickPhoto(maxSelected: 1) { [weak self] images in
+            guard let self = self else { return }
+            if let image = images.first {
+                originalImage = image
+                removeView.setFrontImage(image: originalImage)
+            }
+            self.photoPickerManager.dismissPageVC()
+        }
+    }
+    
+    //保存功能
+    @objc func clickSaveBtn(){
+        if kJudgeVip(externalBool: true, vc: self){ return }
+        removeView.compositeImages { [weak self]  image in
+            if let image = image {
+                PhotoManagerShared.saveImageToAlbum(image) { [weak self] success, error in
+                    guard let self = self else { return }
+                    if success {
+//                        isSavePhotoMark = true
+                        kSaveSuccesswShared.show(atView:self.view)
+                        
+                        if let resultUrl = self.infoModel?.response.resultUrl,
+                           let url = URL(string: resultUrl){
+                            ImageCache.default.store(image, forKey: url.cacheKey)
+                        }
+                    }else{
+                        debugPrint(error)
+                    }
+                }
+            }
+        }
+    }
+}
+extension TSAIRemovePhotoBgVC{
+    
+    func generatorNew() {
+        let operation:TSGenerateBasePhotoOperation = TSGenerateBasePhotoOperationQueue.shared.creatOperation(uuid: self.uuidString)
+        self.operation = operation
+        operation.$stateDatauPblished.receive(on: DispatchQueue.main).sink {[weak self]  (state,model) in
+            guard let self = self else { return }
+            self.upDateView(state: state, model: model)
+        }.store(in: &cancellable)
+        
+        
+        let generatorModel = TSAIListPhotoGeneratorModel(upLoadImage: originalImage, generatorStyle: .removeBg)
+        
+        operation.uploadImage(generateStyleModel: generatorModel)  { [weak self] actionInfoModel in
+            guard let self = self else { return }
+            guard let oldModel = actionInfoModel else {return}
+            generatorCreatRing(oldModel: oldModel)
+        }
+    }
+    
+    func generatorCreatRing(oldModel:TSActionInfoModel) {
+        let operation:TSGenerateBasePhotoOperation = TSGenerateBasePhotoOperationQueue.shared.creatOperation(uuid: self.uuidString)
+        self.operation = operation
+        operation.$stateDatauPblished.receive(on: DispatchQueue.main).sink {[weak self]  (state,model) in
+            guard let self = self else { return }
+            self.upDateView(state: state, model: model)
+        }.store(in: &cancellable)
+        
+        operation.creatImage(oldModel: oldModel){ [weak self]  success in
+            guard let self = self else { return }
+            if success {
+                generateInView.setBackgroundGenerateBtnHidden(true)
+            }
+        }
+    }
+}
+extension TSAIRemovePhotoBgVC {
+    func upDateView(state:TSProgressState,model:TSActionInfoModel?){
+        progressState = state
+        switch state {
+            case .failed(let errorStr,let code):
+                showError(text: errorStr,code:code)
+            case .success:
+                if let model = model {
+                    showSuccess(model: model)
+                }else{
+                    showError(text: "")
+                }
+            case .progressString(let string):
+                showProgress(text: string)
+            default:
+                showLoading()
+        }
+    }
+    
+    func showProgress(text:String) {
+        generateInView.updateShowProgress(text: text)
+    }
+    
+    func showLoading(){
+        generateInView.updateShowLoading(text: "Processing".localized + " " + kPercentlocalized(0))
+    }
+    
+    func showError(text:String,code:Int = 0){
+        generateInView.updateShowError(text: text,code: code)
+    }
+    
+    func showSuccess(model:TSActionInfoModel){
+        generateInView.updateShowSuccess()
+        infoModel = model
+        if let model = infoModel {
+//            complete(model)
+        }
+    }
+}

+ 220 - 0
TSLiveWallpaper/Business/TSAIListVC/TSAIUploadPhotoVC/TSAIPhotoRemoveVC/View/TSAIPhotoRemoveBgView.swift

@@ -0,0 +1,220 @@
+//
+//  TSAIPhotoRemoveBgView.swift
+//  TSLiveWallpaper
+//
+//  Created by 100Years on 2025/7/20.
+//
+
+
+class TSAIPhotoRemoveBgView: TSBaseView {
+    
+    var targetVC:UIViewController
+    
+    init(targetVC: UIViewController) {
+        self.targetVC = targetVC
+        super.init(frame: .zero)
+    }
+    
+    @MainActor required init?(coder: NSCoder) {
+        fatalError("init(coder:) has not been implemented")
+    }
+
+    func setFrontImage(image:UIImage){
+        frontImageView.image = image
+        let frame = kGetSubFrame(superSize:CGSize(width: k_ScreenWidth, height: 482), subViewSize: image.size, contentMode:.scaleAspectFit, scaleFactor: 1.0)
+        bgImageView.snp.remakeConstraints { make in
+            make.center.equalToSuperview()
+            make.size.equalTo(frame.size)
+        }
+    }
+    
+    func setFrontImageURLString(urlString:String){
+        frontImageView.setAsyncImage(urlString: urlString, completion: { [weak self] image in
+            guard let self = self else { return }
+            if let image = image {
+                setFrontImage(image: image)
+            }
+        })
+    }
+    
+    lazy var colorPickerManager = TSColorPickerManager(viewController: targetVC)
+    lazy var photoPickerManager = TSPhotoPickerManager(viewController: targetVC)
+    lazy var cusStackView: TSCustomStackView = TSCustomStackView(axis: .vertical,spacing: 0)
+    lazy var bgImageView: UIImageView = UIImageView.createImageView(image:.generateBackground,contentMode: .scaleAspectFill)//图片生成
+    lazy var frontImageView: UIImageView = UIImageView.createImageView()//图片生成
+    lazy var topContentView: UIView = {
+        let topContentView = UIView()
+
+        topContentView.addSubview(bgImageView)
+        bgImageView.addSubview(frontImageView)
+
+        bgImageView.snp.makeConstraints { make in
+            make.edges.equalToSuperview()
+        }
+        frontImageView.snp.makeConstraints { make in
+            make.edges.equalToSuperview()
+        }
+        
+        return topContentView
+    }()
+
+    lazy var colorBarView: TSColorSeleteBarView = {
+        let colorBarView = TSColorSeleteBarView()
+        colorBarView.colorArray = [
+            TSColorSeleteBarColorModel(icon: UIImage(named: "selete_image"), index: 0, colors: [],clickType: 1),
+            TSColorSeleteBarColorModel(icon: UIImage(named: "selete_clear"), index: 1, colors: [],clickType: 2),
+            TSColorSeleteBarColorModel(icon: UIImage(named: "selete_color"), index: 2, colors: [],clickType: 3),
+            TSColorSeleteBarColorModel(icon: UIImage(named: "selete_color_1"), index: 3, colors: ["#FD0880".uiColor,"#FF6A00".uiColor]),
+            TSColorSeleteBarColorModel(icon: UIImage(named: "selete_color_2"), index: 4, colors: ["#FFE000".uiColor,"#FF4B1F".uiColor]),
+            TSColorSeleteBarColorModel(icon: UIImage(named: "selete_color_3"), index: 5, colors: ["#BEF521".uiColor,"#FFE000".uiColor]),
+            TSColorSeleteBarColorModel(icon: UIImage(named: "selete_color_4"), index: 6, colors: ["#F7FD23".uiColor,"#00C3FF".uiColor]),
+            TSColorSeleteBarColorModel(icon: UIImage(named: "selete_color_5"), index: 7, colors: ["#8223FD".uiColor,"#00C3FF".uiColor]),
+        ]
+        
+        colorBarView.selsetedColorModel = { [weak self]  model in
+            guard let self = self else { return }
+            var model = model
+            if model.clickType == 1 {
+                photoPickerManager.pickPhoto(maxSelected: 1) {[weak self] images in
+                    guard let self = self else { return }
+                    model.image = images.first
+                    photoPickerManager.dismissPageVC()
+                    rvokeTool.addNewoperation(t: model)
+                }
+            }else if model.clickType == 2{
+                model.image = .generateBackground
+                rvokeTool.addNewoperation(t: model)
+            }else if model.clickType == 3{
+                colorPickerManager.pickColor{ [weak self] color in
+                    guard let self = self else { return }
+                    model.color = color
+                    colorPickerManager.dismissPageVC()
+                    rvokeTool.addNewoperation(t: model)
+                }
+            }else{
+                rvokeTool.addNewoperation(t: model)
+            }
+        
+        }
+        return colorBarView
+    }()
+    
+    func bgImageViewClear(){
+        bgImageView.image = .generateBackground
+        bgImageView.backgroundColor = .clear
+        bgImageView.removeSublayers(ofType: CAGradientLayer.self)
+    }
+
+    func setUpNetWorkImageView(model:TSColorSeleteBarColorModel?){
+        bgImageViewClear()
+        guard let model = model else {
+            return
+        }
+        if let image = model.image {
+            bgImageView.image = image
+        }else if let color = model.color {
+            bgImageView.image = .generateBackground
+            bgImageView.backgroundColor = color
+        }else{
+            bgImageView.image = nil
+            var colorCGs:[CGColor] = []
+            for colors in model.colors {
+                colorCGs.append(colors.cgColor)
+            }
+            
+            bgImageView.removeSublayers(ofType: CAGradientLayer.self)
+            bgImageView.addGradientBg(colors: colorCGs,startPoint: CGPoint(x: 0.5, y: 0),endPoint: CGPoint(x: 0.5, y: 1))
+        }
+    }
+    
+    lazy var rvokeTool: TSRevokeTool = {
+        let rvokeTool = TSRevokeTool<TSColorSeleteBarColorModel>()
+        rvokeTool.currentOperationBlock = { [weak self] model,canForBack,canForward in
+            guard let self = self else { return }
+            setUpNetWorkImageView(model: model)
+            backwardBtn.isEnabled = canForBack
+            forwardBtn.isEnabled = canForward
+            colorBarView.selectedIndex = model?.index ?? 1
+        }
+        return rvokeTool
+    }()
+
+    lazy var backwardBtn: TSUIExpandedTouchButton = {
+        let backwardBtn = TSUIExpandedTouchButton()
+        backwardBtn.isEnabled = false
+        backwardBtn.setUpButton(image:.aiRemoveBack){ [weak self]  in
+            guard let self = self else { return }
+            rvokeTool.backward()
+        }
+        return backwardBtn
+    }()
+    
+    lazy var forwardBtn: TSUIExpandedTouchButton = {
+        let forwardBtn = TSUIExpandedTouchButton()
+        forwardBtn.isEnabled = false
+        forwardBtn.setUpButton(image:.aiRemoveGo){ [weak self]  in
+            guard let self = self else { return }
+            rvokeTool.forward()
+        }
+        return forwardBtn
+    }()
+    
+    lazy var rvokeToolView: UIView = {
+        let rvokeToolView = UIView()
+        
+        let titleLab = UILabel.createLabel(text: "Background Color".localized, font: .font(size: 16), textColor: .white)
+        rvokeToolView.addSubview(titleLab)
+        
+        rvokeToolView.addSubview(backwardBtn)
+        rvokeToolView.addSubview(forwardBtn)
+        
+        titleLab.snp.makeConstraints { make in
+            make.leading.equalTo(16)
+            make.centerY.equalToSuperview()
+        }
+        
+        forwardBtn.snp.makeConstraints { make in
+            make.trailing.equalTo(-16)
+            make.centerY.equalToSuperview()
+            make.width.height.equalTo(24)
+        }
+        
+        backwardBtn.snp.makeConstraints { make in
+            make.trailing.equalTo(-60)
+            make.centerY.equalToSuperview()
+            make.width.height.equalTo(24)
+        }
+
+        return rvokeToolView
+    }()
+    
+    
+    override func creatUI() {
+        contentView.addSubview(cusStackView)
+        cusStackView.snp.makeConstraints { make in
+            make.edges.equalToSuperview()
+        }
+        
+        cusStackView.addSubviewToStack(topContentView,length: 482)
+        cusStackView.addSpacing(length: 24)
+        cusStackView.addSubviewToStack(rvokeToolView,length: 48)
+        cusStackView.addSpacing(length: 8)
+        cusStackView.addSubviewToStack(colorBarView,length: 48)
+    }
+
+    func compositeImages(completion: @escaping (UIImage?) -> Void) {
+        if rvokeTool.currentOperation?.clickType == 2 {
+            completion(frontImageView.image)
+        }else{
+            
+            let bottomGradient = bgImageView.layer.sublayers?
+                .first { $0.isKind(of: CAGradientLayer.self) } as? CAGradientLayer
+            ImageCompositor.compositeImages(
+                topImage: frontImageView.image!,
+                bottomImage: bgImageView.image,
+                bottomColor: bgImageView.backgroundColor,
+                bottomGradient: bottomGradient,
+                completion: completion)
+        }
+    }
+}

+ 58 - 0
TSLiveWallpaper/Business/TSAIListVC/TSAIUploadPhotoVC/TSAIPhotoRemoveVC/View/TSColorPickerVC.swift

@@ -0,0 +1,58 @@
+//
+//  TSColorPickerManager.swift
+//  TSLiveWallpaper
+//
+//  Created by 100Years on 2025/7/21.
+//
+
+class TSColorPickerManager:NSObject {
+    var seletedColor:((UIColor?)->Void)?
+    private weak var viewController: UIViewController?
+    init(viewController: UIViewController) {
+        self.viewController = viewController
+    }
+    
+    var colorPicker: UIColorPickerViewController?
+    
+    // MARK: - Public Methods
+    /// 打开照片选择器,单选一张照片
+    func pickColor(completion: @escaping (UIColor?) -> Void) {
+        seletedColor = completion
+        let colorPicker = UIColorPickerViewController()
+        colorPicker.supportsAlpha = true // 是否支持透明度
+        colorPicker.selectedColor = .black
+        colorPicker.delegate = self
+            
+        // 设置为半屏模态
+        if let sheet = colorPicker.sheetPresentationController {
+            sheet.detents = [.medium(), .large()] // 中等高度和全屏
+            sheet.prefersGrabberVisible = true // 显示顶部抓取条
+            sheet.largestUndimmedDetentIdentifier = .medium // 中等高度时不调暗背景
+        }
+        self.colorPicker = colorPicker
+        viewController?.present(colorPicker, animated: true, completion: nil)
+    }
+    
+    
+    func dismissPageVC(){
+        self.colorPicker?.view.isHidden = true
+        self.colorPicker?.dismiss(animated: true)
+        self.colorPicker = nil
+    }
+}
+
+extension TSColorPickerManager : UIColorPickerViewControllerDelegate {
+    func colorPickerViewController(_ viewController: UIColorPickerViewController, didSelect color: UIColor, continuously: Bool) {
+        // continuously为false表示用户完成了选择
+        if !continuously {
+            self.seletedColor?(color)
+        }
+    }
+    
+    func colorPickerViewControllerDidFinish(_ viewController: UIColorPickerViewController) {
+        // 用户点击完成按钮
+        self.seletedColor?(nil)
+        colorPicker?.dismiss(animated: true)
+    }
+}
+

+ 123 - 0
TSLiveWallpaper/Business/TSAIListVC/TSAIUploadPhotoVC/TSAIPhotoRemoveVC/View/TSColorSeleteBarView.swift

@@ -0,0 +1,123 @@
+//
+//  TSColorSeleteBarView.swift
+//  TSLiveWallpaper
+//
+//  Created by 100Years on 2025/7/21.
+//
+
+
+struct TSColorSeleteBarColorModel {
+    var icon:UIImage?
+    var index:Int = 0
+    var colors:[UIColor] = []
+    var color:UIColor?
+    var image:UIImage?
+    var clickType:Int = 0 // 0 什么也不干,1image,2清空 3color
+    init(icon: UIImage?, index: Int, colors: [UIColor], color: UIColor? = nil, image: UIImage? = nil,clickType:Int = 0) {
+        self.icon = icon
+        self.index = index
+        self.colors = colors
+        self.color = color
+        self.image = image
+        self.clickType = clickType
+    }
+}
+
+
+class TSColorSeleteBarView : TSBaseView {
+
+    var selsetedColorModel:((TSColorSeleteBarColorModel)->Void)?
+    var colorArray:[TSColorSeleteBarColorModel] = []{
+        didSet{
+            collectionView.reloadData()
+        }
+    }
+    
+    var selectedIndex:Int = 0{
+        didSet{
+            collectionView.selectItem(at: IndexPath(item: selectedIndex, section: 0), animated: true, scrollPosition: .centeredHorizontally)
+        }
+    }
+    
+    lazy var collectionView: UICollectionView = {
+        let layout = TSBaseCollectionViewFlowLayout()
+        layout.scrollDirection = .horizontal
+        layout.minimumLineSpacing = 16
+        layout.itemSize = CGSize(width: 36, height: 36)
+        let collectionView = TSBaseCollectionView(frame: .zero, collectionViewLayout: layout)
+        collectionView.delegate = self
+        collectionView.dataSource = self
+        collectionView.register(TSColorSeleteBarViewCell.self, forCellWithReuseIdentifier: "TSColorSeleteBarViewCell")
+        collectionView.contentInset = UIEdgeInsets(top: 6, left: 16, bottom: 6, right: 16)
+        return collectionView
+    }()
+    
+
+    override func creatUI() {
+        contentView.addSubview(collectionView)
+        collectionView.snp.makeConstraints { make in
+            make.edges.equalToSuperview()
+        }
+    }
+}
+extension TSColorSeleteBarView: UICollectionViewDataSource ,UICollectionViewDelegate {
+    public func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
+        return colorArray.count
+    }
+    
+    public func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
+        if let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "TSColorSeleteBarViewCell", for: indexPath) as? TSColorSeleteBarViewCell{
+            cell.model = colorArray.safeObj(At: indexPath.row)
+            return cell
+        }
+        return UICollectionViewCell()
+    }
+
+    public func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
+//        collectionView.scrollToItem(at: indexPath, at: .centeredHorizontally, animated: true)
+        if let model = colorArray.safeObj(At: indexPath.row) {
+            selsetedColorModel?(model)
+            selectedIndex = indexPath.item
+        }
+    }
+}
+
+
+class TSColorSeleteBarViewCell: TSBaseCollectionCell {
+    var model:TSColorSeleteBarColorModel? {
+        didSet{
+            guard let model = model else { return }
+            imageView.image = model.icon
+        }
+    }
+    
+    override var isSelected: Bool{
+        didSet{
+            seletedImageView.isHidden = !isSelected
+        }
+    }
+
+    lazy var imageView: UIImageView = {
+        let imageView = UIImageView.createImageView(contentMode: .scaleToFill,backgroundColor: .white.withAlphaComponent(0.2))
+        return imageView
+    }()
+    
+    lazy var seletedImageView: UIImageView = {
+        let imageView = UIImageView.createImageView(imageName: "check_color",contentMode: .scaleToFill,backgroundColor: .white.withAlphaComponent(0.2))
+        imageView.isHidden = true
+        return imageView
+    }()
+
+    override func creatUI() {
+        bgContentView.addSubview(imageView)
+        imageView.snp.makeConstraints { make in
+            make.edges.equalToSuperview()
+        }
+        
+        bgContentView.addSubview(seletedImageView)
+        seletedImageView.snp.makeConstraints { make in
+            make.center.equalToSuperview()
+            make.width.height.equalTo(24)
+        }
+    }
+}

+ 67 - 0
TSLiveWallpaper/Business/TSAIListVC/TSAIUploadPhotoVC/TSAIPhotoRemoveVC/View/TSRevokeTool.swift

@@ -0,0 +1,67 @@
+//
+//  TSRevokeTool.swift
+//  TSLiveWallpaper
+//
+//  Created by 100Years on 2025/7/21.
+//
+
+
+class TSRevokeTool<T>{
+    var index:Int = -1{
+        didSet{
+            dePrint("TSRevokeTool index = \(index)")
+        }
+    }
+    var operationArray:[T] = []
+    var currentOperationBlock:((T?,Bool,Bool)->Void)?
+    var currentOperation:T?{
+        didSet{
+            currentOperationBlock?(currentOperation,canForBack,canForward)
+        }
+    }
+    var canForBack:Bool{
+        return index > -1
+    }
+    
+    var canForward:Bool{
+        return index < operationArray.count-1
+    }
+    func addNewoperation(t:T){
+        if index != operationArray.count - 1{
+            if index + 1 < operationArray.count {
+                operationArray.removeSubrange(index+1 ..< operationArray.count)
+            }
+        }
+        operationArray.append(t)
+        index += 1
+        currentOperation = t
+    }
+    
+    func backward(){
+        let i = index - 1
+        
+        if i < 0 {
+            index = -1
+            currentOperation = nil
+        }else{
+            if let t = operationArray.safeObj(At: i) {
+                index = i
+                currentOperation = t
+            }
+        }
+    }
+    
+    func forward(){
+        let i = index + 1
+        if let t = operationArray.safeObj(At: i) {
+            index = i
+            currentOperation = t
+        }
+    }
+    
+    func clearAll(){
+        operationArray = []
+        index = -1
+        currentOperation = nil
+    }
+}

+ 20 - 4
TSLiveWallpaper/Business/TSMineVC/TSChangeLanguageVC/TSChangeLanguageVC.swift

@@ -67,7 +67,11 @@ extension TSChangeLanguageVC : UITableViewDataSource, UITableViewDelegate {
     public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
         if let cell = tableView.dequeueReusableCell(withIdentifier: "TSChangeLanguageCell") as? TSChangeLanguageCell{
             if let language = dataArray.safeObj(At: indexPath.row){
-                cell.leftLab.text = language.flag
+                if let image = UIImage(named: language.flag) {
+                    cell.leftImageView.image = UIImage(named: language.flag)
+                }else{
+                    cell.leftLab.text = language.flag
+                }
                 cell.textLab.text = language.displayName
                 cell.rightImageView.image = selectedIndex ==  indexPath.row ? .check : .unCheck
             }
@@ -107,9 +111,13 @@ class TSChangeLanguageCell: UITableViewCell {
         fatalError("init(coder:) has not been implemented")
     }
     
-
+    lazy var leftImageView: UIImageView = {
+        let leftImageView = UIImageView.createImageView()
+        return leftImageView
+    }()
+    
     lazy var leftLab: UILabel = {
-        return UILabel.createLabel(font: .font(name:.ZillaSlab,size: 14),textColor: .white)
+        return UILabel.createLabel(font: .font(name:.ZillaSlab,size: 14),textColor: .white,textAlignment: .center)
     }()
     
     lazy var textLab: UILabel = {
@@ -123,16 +131,24 @@ class TSChangeLanguageCell: UITableViewCell {
 
     func creatUI() {
         bgContentView.addSubview(leftLab)
+        bgContentView.addSubview(leftImageView)
         bgContentView.addSubview(textLab)
         bgContentView.addSubview(rightImageView)
 
+        leftImageView.snp.makeConstraints { make in
+            make.leading.equalTo(16)
+            make.centerY.equalToSuperview()
+            make.width.height.equalTo(20)
+        }
+        
         leftLab.snp.makeConstraints { make in
             make.leading.equalTo(16)
             make.centerY.equalToSuperview()
+            make.width.height.equalTo(20)
         }
     
         textLab.snp.makeConstraints { make in
-            make.leading.equalTo(leftLab.snp.trailing).offset(12)
+            make.leading.equalTo(leftImageView.snp.trailing).offset(12)
             make.centerY.equalToSuperview()
         }
         

+ 29 - 0
TSLiveWallpaper/Business/TSTabBarController/TSTabBarController.swift

@@ -33,6 +33,7 @@ class TSTabBarController: UITabBarController {
         setUpData()
         createUI()
         monitorEvent()
+        setupDoubleTapToScrollTop()
     }
 
     let dotSize:CGFloat = 6.0
@@ -224,3 +225,31 @@ extension TSTabBarController {
         }
     }
 }
+
+protocol TSTabBarControllerProtocol {
+    func tabBarDoubleTap(_ tabbar: UITabBarController)
+}
+
+extension TSTabBarController {
+    func setupDoubleTapToScrollTop() {
+        let doubleTap = UITapGestureRecognizer(target: self, action: #selector(handleDoubleTap(_:)))
+        doubleTap.numberOfTapsRequired = 2
+        tabBar.addGestureRecognizer(doubleTap)
+    }
+
+    @objc private func handleDoubleTap(_ gesture: UITapGestureRecognizer) {
+        guard gesture.state == .ended else { return }
+        guard let vc = selectedViewController else { return }
+        
+        if let vc = vc as? TSTabBarControllerProtocol{
+            vc.tabBarDoubleTap(self)
+        }else if let nav = vc as? UINavigationController {
+            if let topVC = nav.topViewController {
+                
+                if let vc = topVC as? TSTabBarControllerProtocol{
+                    vc.tabBarDoubleTap(self)
+                }
+            }
+        }
+    }
+}

+ 4 - 2
TSLiveWallpaper/Common/Purchase/TSPurchaseBusiness.swift

@@ -11,7 +11,8 @@ private let kTotalUseNumKey = "kTotalUseNumKey"
 public enum VipFreeNumType: String, CaseIterable {
     case none = "kNone"
     case general = "kGeneralAI" //通用的 vip
-    case generalVideo = "kGeneralVideo" //通用的 vip
+    case generalVideo = "kGeneralVideo" //视频
+    case generalRemoveBg = "kGeneralRemoveBg" //通用的 vip
 }
 
 let kPurchaseBusiness = TSPurchaseBusiness.shared
@@ -89,7 +90,8 @@ class TSPurchaseBusiness {
         }else{
             freeDict = [
                 VipFreeNumType.general.rawValue:1,
-                VipFreeNumType.generalVideo.rawValue:1
+                VipFreeNumType.generalVideo.rawValue:1,
+                VipFreeNumType.generalRemoveBg.rawValue:1
             ]
             saveForFree()
         }

+ 3 - 3
TSLiveWallpaper/Common/Purchase/TSPurchaseManager.swift

@@ -82,9 +82,9 @@ public class PurchaseManager: NSObject {
     }
 
     @objc public var isVip: Bool {
-        #if DEBUG
-        return true
-        #endif
+//        #if DEBUG
+//        return true
+//        #endif
         guard let expiresDate = expiredDate else {
             return false
         }

+ 7 - 18
TSLiveWallpaper/Common/TSNetWork/TSNetWork+Business.swift

@@ -13,14 +13,13 @@ enum TSNeURLType:String {
 
     case actionInfo = "/api/action/info"         //查询生成过程接口
     case upload = "/api/upload"                  //上传图片
-    case imageRewrite = "/api/image/rewrite"     //图生图
-//
     case config = "/api/ops/old-photo-config"       //App配置
+    
+    case imageRewrite = "/api/image/rewrite"     //图生图
     case createVideo = "/api/video/create"               //视频生成
     case imageInpaint = "/api/image/inpaint"             //图片涂抹
-
-
-
+    case removeBg = "/api/image/remove-background"       //移除背景
+    
     
     func getUrlString() -> String {
         if Locale.current.identifier.contains("_CN") {//中国区
@@ -37,20 +36,10 @@ enum TSNeURLType:String {
     ///需要进行次数验证的接口
     var validateURLTypeList : [TSNeURLType] {
         [
-//            .textPicCreate,
-            .upload,
             .imageRewrite,
-//         .changeAge,
-//         .subscriptionApple,
-//         .changeEmotion,
-//         .changeHair,
-//         .imageRestore,
-//         .eyeOpen,
-//         .pretty,
-//         .photoAnimation,
-//         .photoExpand,
-//         .overResolution,
-//         .changeClothes
+            .createVideo,
+            .imageInpaint,
+            .removeBg
         ]
     }
 }

+ 4 - 0
TSLiveWallpaper/Common/Tool/LanguageManager.swift

@@ -29,6 +29,7 @@ class LanguageManager {
     
     // 支持的语言列表
     enum AppLanguage: String, CaseIterable {
+        case system = "system" // 跟随系统
         case en = "en"    // 英语
         case es = "es"    // 西班牙
         case ar = "ar"    // 阿拉伯语
@@ -42,6 +43,7 @@ class LanguageManager {
         
         var displayName: String {
             switch self {
+            case .system: return "system"
             case .en: return "English"
             case .ja: return "日本語"
             case .ar: return "العربية"
@@ -57,6 +59,7 @@ class LanguageManager {
         
         var flag: String {
             switch self {
+            case .system: return "language_System"
             case .en: return "🇺🇸"
             case .ja: return "🇯🇵"
             case .ar: return "🇸🇦"
@@ -82,6 +85,7 @@ class LanguageManager {
             case .de: return .german
             case .it: return .custom(Bundle(path: Bundle.main.path(forResource: "it", ofType: "lproj")!)!)
             case .pt: return .portuguese
+            case .system: return .system
             }
         }
     }

+ 35 - 188
TSLiveWallpaper/Common/ViewTool/TSPhotoPickerManager/TSPhotoPickerManager.swift

@@ -66,17 +66,41 @@ class TSPhotoPickerManager: NSObject {
         config.photoList.bottomView.isShowSelectedView = true
         config.photoList.previewStyle = .push
         
-//        let cropSize = EditorConfiguration.ToolsView.Options(
-//            imageType: HX.ImageResource.ImageType,
-//            type: .cropSize
-//        )
-//        config.editor.toolsView = .init(toolOptions: [cropSize])
-//        config.editor.toolsView.toolOptions = [EditorConfiguration.ToolsView.Options.cropSize]
         
-        var cameraConfig = SystemCameraConfiguration()
-        cameraConfig.allowsEditing = false
+        let cropSize = EditorConfiguration.ToolsView.Options(
+            imageType: HX.ImageResource.shared.editor.tools.cropSize,
+            type: .cropSize
+        )
+        config.editor.toolsView = .init(toolOptions: [cropSize])
+        let aspectRatios:[EditorRatioToolConfig] = [
+            .init(title: .localized("原始比例"), ratio: .init(width: -1, height: -1)),
+            .init(title: .localized("自由格式"), ratio: .zero),
+            .init(title: .localized("正方形"), ratio: .init(width: 1, height: 1)),
+            .init(title: .custom("9:16"), ratio: .init(width: 9, height: 16)),
+            .init(title: .custom("16:9"), ratio: .init(width: 16, height: 9)),
+            .init(title: .custom("3:4"), ratio: .init(width: 3, height: 4)),
+            .init(title: .custom("4:3"), ratio: .init(width: 4, height: 3)),
+            .init(title: .custom("2:3"), ratio: .init(width: 2, height: 3)),
+            .init(title: .custom("3:2"), ratio: .init(width: 3, height: 2))
+        ]
+        
+        config.editor.cropSize.aspectRatios = aspectRatios
+        
+        
+//        var cameraConfig = SystemCameraConfiguration()
+//        cameraConfig.allowsEditing = false
+//        config.photoList.cameraType = .system(cameraConfig)
+        
+        
+        var customCameraConfig = CameraConfiguration()
+        customCameraConfig.isSaveSystemAlbum = true
+        customCameraConfig.sessionPreset = .hd1920x1080
+        customCameraConfig.aspectRatio = .fullScreen
+        customCameraConfig.editor.toolsView = .init(toolOptions: [cropSize])
+        customCameraConfig.editor.cropSize.aspectRatios = aspectRatios
+        config.photoList.cameraType = .custom(customCameraConfig)
+    
         config.appearanceStyle = .dark
-        config.photoList.cameraType = .system(cameraConfig)
         return config
     }()
     
@@ -127,13 +151,9 @@ class TSPhotoPickerManager: NSObject {
     
     /// 打开照片选择器
     private func openPhotoPicker() {
-        
-//        var config = config
-//        if maxSelected > 1 {
+ 
         var config = multipleConfig
-            config.maximumSelectedCount = maxSelected
-//        }
-        
+        config.maximumSelectedCount = maxSelected
         config.languageType = LanguageManager.shared.currentLanguage.languageType
         config.customLanguages = [CustomLanguage(language: "it", bundle: Bundle(path: Bundle.main.path(forResource: "it", ofType: "lproj")!)!)]
         
@@ -183,176 +203,3 @@ extension TSPhotoPickerManager: PhotoPickerControllerDelegate {
         pickerController.dismiss(animated: true, completion: nil)
     }
 }
-
-
-
-//class TSPhotoPickerManager: NSObject {
-//    
-//    // MARK: - Properties
-//    private weak var viewController: UIViewController?
-//    private var completionHandler: ((UIImage?,PHAsset?) -> Void)?
-//    private var completionSizeHandler: ((UIImage?,String?) -> Void)?
-//    private var imagePicker = UIImagePickerController()
-//    // MARK: - Initializers
-//    init(viewController: UIViewController) {
-//        self.viewController = viewController
-//    }
-//    
-//    // MARK: - Public Methods
-//    /// 打开照片选择器,单选一张照片
-//    func pickSinglePhoto(completion: @escaping (UIImage?,PHAsset?) -> Void) {
-//        self.completionHandler = completion
-//        // 检查相册权限
-//        checkPhotoLibraryPermission { [weak self] authorized in
-//            guard let self = self else { return }
-//            if authorized {
-//                self.openPhotoPicker()
-//            } else {
-//                self.showPermissionAlert()
-//            }
-//        }
-//    }
-//    
-//    // MARK: - Private Methods
-//    /// 检查相册权限
-//    private func checkPhotoLibraryPermission(completion: @escaping (Bool) -> Void) {
-//        let status = PHPhotoLibrary.authorizationStatus()
-//        switch status {
-//        case .authorized:
-//            completion(true)
-//        case .notDetermined:
-//            PHPhotoLibrary.requestAuthorization { newStatus in
-//                DispatchQueue.main.async {
-//                    completion(newStatus == .authorized)
-//                }
-//            }
-//        default:
-//            completion(false)
-//        }
-//    }
-//    
-//    /// 打开照片选择器
-//    private func openPhotoPicker() {
-//        TSToastShared.showLoading(containerView: viewController?.view)
-//        imagePicker = UIImagePickerController()
-//        imagePicker.sourceType = .photoLibrary
-//        imagePicker.delegate = self
-//        imagePicker.mediaTypes = ["public.image"] // 只选择照片
-////        imagePicker.modalPresentationStyle = .custom
-////        imagePicker.modalTransitionStyle = .crossDissolve
-//        if #available(iOS 13.0, *) {
-//            imagePicker.overrideUserInterfaceStyle = .dark
-//        }
-//        viewController?.present(imagePicker, animated: true){
-//            TSToastShared.hideLoading()
-//        }
-//        
-//        kMainAfter(3.0) {
-//            TSToastShared.hideLoading()
-//        }
-//    }
-//    
-//    /// 显示权限提示
-//    private func showPermissionAlert() {
-//        let alert = UIAlertController(
-//            title: "No photos permission".localized,
-//            message: "Please enable photo permission in settings to select photos".localized,
-//            preferredStyle: .alert
-//        )
-//        alert.addAction(UIAlertAction(title: "Cancel".localized, style: .cancel, handler: nil))
-//        alert.addAction(UIAlertAction(title: "Go to Settings".localized, style: .default) { _ in
-//            if let url = URL(string: UIApplication.openSettingsURLString) {
-//                UIApplication.shared.open(url, options: [:], completionHandler: nil)
-//            }
-//        })
-//        viewController?.present(alert, animated: true, completion: nil)
-//    }
-//    
-//    deinit {
-//        debugPrint("♻️♻️♻️ TSPhotoPickerManager -> TSPhotoPickerManager deinit ♻️♻️♻️")
-//    }
-//}
-//
-//// MARK: - UIImagePickerControllerDelegate & UINavigationControllerDelegate (iOS 14 以下)
-//extension TSPhotoPickerManager: UIImagePickerControllerDelegate, UINavigationControllerDelegate {
-//    func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) {
-////        picker.dismiss(animated: true) {
-//            if let image = info[.originalImage] as? UIImage {
-//                self.completionHandler?(image,info[.phAsset] as? PHAsset )
-//            } else {
-//                self.completionHandler?(nil,nil)
-//            }
-////        }
-//        
-//        if completionSizeHandler == nil {
-//            picker.dismiss(animated: true, completion: nil)
-//        }
-//
-//    }
-//    
-//    func imagePickerControllerDidCancel(_ picker: UIImagePickerController) {
-////        self.completionHandler?(nil,nil)
-////        if completionSizeHandler == nil {
-//            picker.dismiss(animated: true, completion: nil)
-////        }
-//    }
-//}
-//
-//
-//
-//extension TSPhotoPickerManager{
-//    
-//    func pickCustomSinglePhoto(completion: @escaping (UIImage?,String?) -> Void) {
-//        self.completionSizeHandler = completion
-//        pickSinglePhoto { [weak self] image,phAsset in
-//            guard let self = self else { return }
-//            self.completionSizeHandler?(image,nil)
-//            self.completionSizeHandler = nil
-//        }
-//    }
-//    
-//    // MARK: - Public Methods
-//    /// 打开照片选择器,单选一张照片
-//    func pickSinglePhoto(maxBitSize:Int, completion: @escaping (UIImage?,String?) -> Void) {
-//        self.completionSizeHandler = completion
-//
-//        let maxmbSize = Int(Double(maxBitSize) / (1024 * 1024))
-//        pickSinglePhoto { [weak self] image,phAsset in
-//            guard let self = self else { return }
-//            if let image = image,let phAsset = phAsset {
-//                // 方法2:异步获取详细大小(不阻塞主线程)
-//                TSPhotoSizeHelper.getImageFileSizeAsync(asset: phAsset) {[weak self] size in
-//                    guard let self = self else { return }
-//                    
-//                    let mbSize = Double(size) / (1024 * 1024)
-//                    print("精确大小: \(mbSize) MB,size = \(size)")
-//                    if size > maxBitSize {
-//                        self.completionSizeHandler?(nil,String(format: "Photo must be smaller than %dMB.".localized, maxmbSize))
-//                    }else{
-//                        self.completionSizeHandler?(image,nil)
-//                        self.completionSizeHandler = nil
-////                        imagePicker.dismiss(animated: true)
-//                    }
-//                }
-//            }else{
-//                if let image = image {
-//                    if image.isLargerThan(byteSize: maxBitSize) {
-//                        self.completionSizeHandler?(nil,String(format: "Photo must be smaller than %dMB.".localized, maxmbSize))
-//                    }else{
-//                        self.completionSizeHandler?(image,nil)
-//                        self.completionSizeHandler = nil
-////                        imagePicker.dismiss(animated: true)
-//                    }
-//                }else{
-//                    self.completionSizeHandler?(nil,nil)
-////                    imagePicker.dismiss(animated: true)
-//                }
-//            }
-//        }
-//    }
-//    
-//    func dismissPageVC(){
-//        self.imagePicker.view.isHidden = true
-//        self.imagePicker.dismiss(animated: true)
-//    }
-//}

+ 1 - 2
TSLiveWallpaper/Data/Model/TSActionInfoModel.swift

@@ -63,7 +63,7 @@ extension TSActionInfoModel {
     
     //是否是只显示单张的图片
     var isShowSingleImage:Bool{
-        return request.generatorStyle == TSGeneratorImageStyle.portraitFusion
+        return request.generatorStyle == TSGeneratorImageStyle.portraitFusion || request.generatorStyle == TSGeneratorImageStyle.removeBg
     }
 
     var upImageURLExpired:Bool{
@@ -112,7 +112,6 @@ class TSActionResponseModel : TSBaseModel {
     var previewUrl:String = ""
     var videoDocument:String = ""
     
-    
     var code:Int = 0
     var vip:Bool = false
     

+ 4 - 6
TSLiveWallpaper/Data/OperationQueue/TSGenerateBaseOperation/TSGenerateBasePhotoOperation.swift

@@ -65,12 +65,7 @@ class TSGenerateBasePhotoOperation: TSGenerateBaseOperation , @unchecked Sendabl
         TSRMShared.aiListDB.updateData(currentActionInfoModel,uuid: uuid)
     }
     override func handleGenerateSuccess() {
-        if currentActionInfoModel.request.generatorStyle == .creatVideo {
-            kPurchaseBusiness.useOnceForFree(type: .generalVideo)
-        }else{
-            kPurchaseBusiness.useOnceForFree(type: .general)
-        }
-        
+        kPurchaseBusiness.useOnceForFree(type: currentActionInfoModel.request.generatorStyle.vipFreeNumType)
         saveDataDB()
 
         //生成成功后,不再提示用户上传规则弹窗
@@ -339,6 +334,9 @@ extension TSGenerateBasePhotoOperation {
             postDict["prompt"] = request.prompt
             postDict["imageUrls"] = request.imageUrls
             postDict.removeValue(forKey: "imageUrl")
+        case .removeBg:
+            urlType = .removeBg
+            postDict["maskUrl"] = request.imageUrls.last ?? request.imageUrl
         default:
             postDict["prompt"] = request.prompt
             break;

+ 3 - 0
TSLiveWallpaper/ar.lproj/Localizable.strings

@@ -167,3 +167,6 @@
 "Lifetime" = "العضوية مدى الحياة";
 "Share" = "يشارك";
 "Remove scratches and add realistic color instantly" = "قم بإزالة الخدوش وأضف لونًا واقعيًا على الفور";
+"Remove Background" = "إزالة الخلفية";
+"Erase image backgrounds with one tap" = "مسح خلفيات الصور بنقرة واحدة";
+"Background Color" = "لون الخلفية";

+ 3 - 0
TSLiveWallpaper/de.lproj/Localizable.strings

@@ -158,3 +158,6 @@
 "Lifetime" = "Lebenslange Mitgliedschaft";
 "Share" = "Aktie";
 "Remove scratches and add realistic color instantly" = "Entfernen Sie Kratzer und fügen Sie sofort realistische Farben hinzu";
+"Remove Background" = "Hintergrund entfernen";
+"Erase image backgrounds with one tap" = "Löschen Sie Bildhintergründe mit einem Fingertipp";
+"Background Color" = "Hintergrundfarbe";

+ 3 - 0
TSLiveWallpaper/en.lproj/Localizable.strings

@@ -166,3 +166,6 @@
 "Lifetime" = "Lifetime";
 "Share" = "Share";
 "Remove scratches and add realistic color instantly" = "Remove scratches and add realistic color instantly";
+"Remove Background" = "Remove Background";
+"Erase image backgrounds with one tap" = "Erase image backgrounds with one tap";
+"Background Color" = "Background Color";

+ 3 - 0
TSLiveWallpaper/es.lproj/Localizable.strings

@@ -167,3 +167,6 @@
 "Lifetime" = "Membresía de por vida";
 "Share" = "Compartir";
 "Remove scratches and add realistic color instantly" = "Elimina rayones y añade color realista al instante";
+"Remove Background" = "Eliminar fondo";
+"Erase image backgrounds with one tap" = "Borrar fondos de imágenes con un toque";
+"Background Color" = "Color de fondo";

+ 3 - 0
TSLiveWallpaper/fr.lproj/Localizable.strings

@@ -159,3 +159,6 @@
 "Lifetime" = "Adhésion à vie";
 "Share" = "Partager";
 "Remove scratches and add realistic color instantly" = "Supprimez les rayures et ajoutez instantanément une couleur réaliste";
+"Remove Background" = "Supprimer l'arrière-plan";
+"Erase image backgrounds with one tap" = "Effacer l'arrière-plan des images en un seul clic";
+"Background Color" = "Couleur d'arrière-plan";

+ 3 - 0
TSLiveWallpaper/it.lproj/Localizable.strings

@@ -168,3 +168,6 @@
 "Lifetime" = "Abbonamento a vita";
 "Share" = "Condividere";
 "Remove scratches and add realistic color instantly" = "Rimuove i graffi e aggiunge colori realistici all'istante";
+"Remove Background" = "Rimuovi sfondo";
+"Erase image backgrounds with one tap" = "Cancella gli sfondi delle immagini con un tocco";
+"Background Color" = "Colore di sfondo";

+ 3 - 0
TSLiveWallpaper/ja.lproj/Localizable.strings

@@ -165,3 +165,6 @@
 "Lifetime" = "生涯会員";
 "Share" = "共有";
 "Remove scratches and add realistic color instantly" = "傷を取り除き、リアルな色を瞬時に追加します";
+"Remove Background" = "背景を削除";
+"Erase image backgrounds with one tap" = "ワンタップで画像の背景を消去";
+"Background Color" = "背景色";

+ 3 - 0
TSLiveWallpaper/ko.lproj/Localizable.strings

@@ -165,3 +165,6 @@
 "Lifetime" = "평생 회원권";
 "Share" = "공유하다";
 "Remove scratches and add realistic color instantly" = "긁힌 자국을 제거하고 사실적인 색상을 즉시 추가합니다";
+"Remove Background" = "배경 제거";
+"Erase image backgrounds with one tap" = "한 번의 탭으로 이미지 배경 지우기";
+"Background Color" = "배경색";

+ 3 - 0
TSLiveWallpaper/pt-BR.lproj/Localizable.strings

@@ -159,3 +159,6 @@
 "Lifetime" = "Associação vitalícia";
 "Share" = "Compartilhar";
 "Remove scratches and add realistic color instantly" = "Remova arranhões e adicione cores realistas instantaneamente";
+"Remove Background" = "Remover fundo";
+"Erase image backgrounds with one tap" = "Apague fundos de imagens com um toque";
+"Background Color" = "Cor de fundo";

+ 3 - 0
TSLiveWallpaper/pt-PT.lproj/Localizable.strings

@@ -159,3 +159,6 @@
 "Lifetime" = "Associação vitalícia";
 "Share" = "Compartilhar";
 "Remove scratches and add realistic color instantly" = "Remova arranhões e adicione cores realistas instantaneamente";
+"Remove Background" = "Remover fundo";
+"Erase image backgrounds with one tap" = "Apague fundos de imagens com um toque";
+"Background Color" = "Cor de fundo";

+ 3 - 0
TSLiveWallpaper/zh-Hant.lproj/Localizable.strings

@@ -165,3 +165,6 @@
 "Lifetime" = "終身會員";
 "Share" = "分享";
 "Remove scratches and add realistic color instantly" = "立即去除刮痕並添加逼真的色彩";
+"Remove Background" = "刪除背景";
+"Erase image backgrounds with one tap" = "一鍵擦除圖像背景";
+"Background Color" = "背景顏色";