PixelSDK
The modern photo and video editor for your iPhone / iPad app. A fully customizable image & video editing iOS Swift framework.
Install / Use
/learn @GottaYotta/PixelSDKREADME
[!CAUTION] Pixel SDK will sunset on February 3, 2025. We are not accepting new customers at this time. Thank you for being part of our journey.
Pixel SDK
Pixel SDK is a photo and video editing framework written in Swift.
<p align="center"> <img src="https://www.cdn.pixelsdk.com/assets/img/screenshots/sdk/library_1_border.jpg" alt="Screenshot" width="23.6%" height="auto" class="docs-screenshot"/> <img src="https://www.cdn.pixelsdk.com/assets/img/screenshots/sdk/edit_1_border.jpg" alt="Screenshot" width="23.6%" height="auto" class="docs-screenshot"/> <img src="https://www.cdn.pixelsdk.com/assets/img/screenshots/sdk/edit_7_border.jpg" alt="Screenshot" width="23.6%" height="auto" class="docs-screenshot"/> <img src="https://www.cdn.pixelsdk.com/assets/img/screenshots/sdk/edit_3_border.gifx" alt="Screenshot" width="23.6%" height="auto" class="docs-screenshot"/> </p>- Features
- Getting Started
- Restrict the SDK
- Present the Editor
- Programmatic Editing
- Export Media
- Transcode Media
- Write Custom Filters
- Customize Colors
- License
Features
✅ Fully Customizable Filters with 40+ Included Filters and Visual Effects
✅ Vine Style Video Camera
✅ Auto-Saving Drafts
✅ Video Segment Composing, Trimming, Scaling, and Re-ordering
✅ Photo and Video Adjustments (Brightness, Vibrance, Saturation, Contrast, Exposure, Hue, Warmth, Sharpness, Gamma, Highlights, Shadows, Vignette)
✅ Cropping, Rotation, and Horizontal/Vertical Perspective Correction
✅ Adjust Individual Video Segments and Whole Video Composition
✅ Programmatic and Visual Editing
✅ Press and Hold Photo/Video to See Original While Editing
✅ Landscape, Portrait and or Square Content Support
✅ Swipe for Realtime Camera Filters
✅ Top Down Photo Mode
✅ Camera Brightness and Tap to Focus
✅ Share Directly to Facebook, Instagram or Twitter.
✅ Custom Colors and Dark Mode Support.
✅ Localized in 40+ Languages and Dynamic Type Accessibility Support.
✅ Import Photos and Videos from DSLR Camera. Lightning to USB Cable Required.
✅ Direct GPU Access with Metal and GPUImage3.
✅ Transcode Video Files with Codecs, Filters, Trimming and more.
✅ RAW Images and 60fps 4K UHD Video Support. HEVC Support.
✅ Full Documentation.
<br> <p align="center"> <img src="https://www.cdn.pixelsdk.com/assets/img/screenshots/sdk/camera_1_border.jpg" alt="Screenshot" width="23.6%" height="auto" class="docs-screenshot"/> <img src="https://www.cdn.pixelsdk.com/assets/img/screenshots/sdk/edit_4_border.jpg" alt="Screenshot" width="23.6%" height="auto" class="docs-screenshot"/> <img src="https://www.cdn.pixelsdk.com/assets/img/screenshots/sdk/edit_5_border.jpg" alt="Screenshot" width="23.6%" height="auto" class="docs-screenshot"/> <img src="https://www.cdn.pixelsdk.com/assets/img/screenshots/sdk/edit_6_border.jpg" alt="Screenshot" width="23.6%" height="auto" class="docs-screenshot"/> </p>Requirements
- iPhone or iPad
- iOS 11+
- Xcode 11.4+
Getting Started
[!CAUTION] Pixel SDK will sunset on February 3, 2025. We are not accepting new customers at this time. Thank you for being part of our journey.
Note: Extensive sample code can be found in the Xcode sample project. <getting-started-supplement>
Swift Package Manager (Recommended)
Swift Package Manager is a dependency manager built into Xcode. To integrate PixelSDK into your Xcode project using Swift Package Manager, first verify you have the latest version of Xcode installed.
In the Xcode menu bar select File > Add Packages and enter the following repository URL into the search bar:
https://github.com/GottaYotta/PixelSDK.git
For Dependency Rule select Branch and master. Then press Add Package.
Note: We do not recommend setting the Dependency Rule to a major version because it will prevent you from receiving critical bug fixes in the future.
CocoaPods
CocoaPods is a dependency manager for iOS projects. To integrate PixelSDK into your Xcode project using CocoaPods, first verify you have at least Xcode 11.4 or greater installed.
Then, ensure you have the latest version of CocoaPods installed by running the following command:
$ sudo gem install cocoapods
Specify PixelSDK in your Podfile:
pod 'PixelSDK'
Run the following command from within your project directory:
$ pod install
Setup
Include the following lines in your application Info.plist:
<key>NSPhotoLibraryUsageDescription</key>
<string>Photo access is needed so you can select photos from your library.</string>
<key>NSMicrophoneUsageDescription</key>
<string>Microphone access is needed so you can record video with sound.</string>
<key>NSCameraUsageDescription</key>
<string>Camera access is needed so you can take photos.</string>
Present the SDK in response to a user action, for example, clicking a button. The default primary filters and adjustment filters will be used. The SDK will support both photo and video of any dimension with access to both the camera and library.
import PixelSDK
let container = ContainerController()
container.editControllerDelegate = self
let nav = UINavigationController(rootViewController: container)
nav.modalPresentationStyle = .fullScreen
self.present(nav, animated: true, completion: nil)
Also implement its delegate method. This delegate method will be called when the Next button in the EditController is pressed. In response you should either dismiss the UINavigationController or push a new controller on. The below example pushes a blank controller on. Then use the provided session parameter to export your photo or video at your own convenience.
extension ViewController: EditControllerDelegate {
func editController(_ editController: EditController, didFinishEditing session: Session) {
let controller = UIViewController()
editController.navigationController?.pushViewController(controller, animated: true)
}
}
Generate an API key and specify it in your application(_, didFinishLaunchingWithOptions:) of your App Delegate. <span style="display: none;">The following pricing options are available for your API key.</span> Without an API key, image and video exports will include a watermark. Keep your API key private.
import PixelSDK
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
PixelSDK.setup("YOUR API KEY")
return true
}
Optionally, specify a maximum video duration. The default maximum video duration is 80 seconds.
// Set the maximum video duration to 3 minutes.
PixelSDK.shared.maxVideoDuration = 60*3
That's it! You now have full access to the SDK.
Restrict the SDK
Images Only
The below example presents the SDK with only support for images. The user will have access to both the library and camera.
// Show only the library and photo camera modes in the tab bar
let container = ContainerController(modes: [.library, .photo])
container.editControllerDelegate = self
// Include only images from the users photo library
container.libraryController.fetchPredicate = NSPredicate(format: "mediaType == %d", PHAssetMediaType.image.rawValue)
// Include only images from the users drafts
container.libraryController.draftMediaTypes = [.image]
let nav = UINavigationController(rootViewController: container)
nav.modalPresentationStyle = .fullScreen
self.present(nav, animated: true, completion: nil)
Videos Only
The below example presents the SDK with only support for videos. The user will have access to both the library and camera.
// Show only the library and video camera modes in the tab bar
let container = ContainerController(modes: [.library, .video])
container.editControllerDelegate = self
// Include only videos from the users photo library
container.libraryController.fetchPredicate = NSPredicate(format: "mediaType == %d", PHAssetMediaType.video.rawValue)
// Include only videos from the users drafts
container.libraryController.draftMediaTypes = [.video]
let nav = UINavigationController(rootViewController: container)
nav.modalPresentationStyle = .fullScreen
self.present(nav, animated: true, completion: nil)
Square Content Only
The below example presents the SDK with only support for creating square photos and videos. The user will have access to both the library and camera.
let container = ContainerController()
container.editControllerDelegate = self
// Only allow square content from the library cropper
container.libraryController.previewCropController.aspectRatio = CGSize(width: 1, height: 1)
// Only allow square content from the camera controller
container.cameraController.aspectRatio = CGSize(width: 1, height: 1)
let nav = UINavigationController(rootViewController: co
