{"id":13828900,"url":"https://github.com/liangdrime/PrismaSimpleImagePicker","last_synced_at":"2025-07-09T07:30:52.581Z","repository":{"id":199370292,"uuid":"64484316","full_name":"liangdrime/PrismaSimpleImagePicker","owner":"liangdrime","description":"This is a copy of the Prisma APP. Reproduce Prisma custom camera, image picker and picture editor","archived":false,"fork":false,"pushed_at":"2018-03-12T03:55:00.000Z","size":44571,"stargazers_count":592,"open_issues_count":5,"forks_count":98,"subscribers_count":12,"default_branch":"master","last_synced_at":"2024-05-19T12:28:43.657Z","etag":null,"topics":["custom-camera","image-picker","photo-album","prisma"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/liangdrime.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2016-07-29T13:54:44.000Z","updated_at":"2024-04-01T11:13:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"f5e66dad-c1e1-45da-ab0a-d8625f2e3b50","html_url":"https://github.com/liangdrime/PrismaSimpleImagePicker","commit_stats":null,"previous_names":["liangdrime/prismasimpleimagepicker","roylee-ml/prismasimpleimagepicker"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liangdrime%2FPrismaSimpleImagePicker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liangdrime%2FPrismaSimpleImagePicker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liangdrime%2FPrismaSimpleImagePicker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liangdrime%2FPrismaSimpleImagePicker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/liangdrime","download_url":"https://codeload.github.com/liangdrime/PrismaSimpleImagePicker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225492420,"owners_count":17482869,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["custom-camera","image-picker","photo-album","prisma"],"created_at":"2024-08-04T09:03:19.086Z","updated_at":"2024-11-20T08:31:26.958Z","avatar_url":"https://github.com/liangdrime.png","language":"Swift","funding_links":[],"categories":["Swift"],"sub_categories":[],"readme":"# PrismaSimpleImagePicker\n\n\n![Logo](https://github.com/Roylee-ML/PrismaSimpleImagePicker/blob/master/ScreenShots/logo.png)\n\n\nCustom camera, image picker ,image editor and the interface just like Prisma's style.\n\n\n# Overview\n\n\u003cimg src=\"https://github.com/Roylee-ML/PrismaSimpleImagePicker/blob/master/ScreenShots/screenshot1.gif\" width = \"272\" height = \"480\" alt=\"OverView1\" align=center /\u003e\n\u003cimg src=\"https://github.com/Roylee-ML/PrismaSimpleImagePicker/blob/master/ScreenShots/screenshot2.gif\" width = \"272\" height = \"480\" alt=\"OverView2\" align=center /\u003e\n\u003cimg src=\"https://github.com/Roylee-ML/PrismaSimpleImagePicker/blob/master/ScreenShots/screenshot3.gif\" width = \"272\" height = \"480\" alt=\"OverView3\" align=center /\u003e\n\n\n\n# Introduction\n\n### This is just a client function copy of Prisma, not a pod solution\n\nPrisma is a sucessful APP of photo editing, but it's success is more than just art. And the details of the Prisma is also very good. So, I try to reproduce the client function of Prisma use Swift, and the result is this project.\n\nThis is build with Storyboard and xib, just because the Prisma is also used Storyboard and xib. The follow is the struct:\n\n![Struct](https://github.com/Roylee-ML/PrismaSimpleImagePicker/blob/master/ScreenShots/prismanib.png)\n\n\n### What is the use of this project?\n\n**Firstly**, we can learn how to custom camera use framework AVFoundation.\n\n\u003e * **AVCaptureSession**  A session to manage camera, responsible for the video image management function\n\u003e * **AVCaptureDeviceInput**  Do the image acquisition\n\u003e * **AVCaptureStillImageOutput** Function for image stream output\n\u003e * **AVCaptureVideoPreviewLayer** Video preview layer, used to display the scene of the camera in real time\n\nThere is one thing we need to pay attention when we custom a camera, it's the image's orientation. Because the normal orientation of iPhone camera is lanscape left(Home button on the right), so the image orientation is different from our expected result. Below is a comparison.\n\n![Camera position](https://github.com/Roylee-ML/PrismaSimpleImagePicker/blob/master/ScreenShots/possion.png) \n\n\n**Secondly**, from this project we can learn about some kowledge of system photo album. Because just support iOS8 above, so I use framework Photos to complete photo select, not the AssetsLibrary frmawork Prisma used. And below is the frameworks Prisma used.\n\n![Frameworks](https://github.com/Roylee-ML/PrismaSimpleImagePicker/blob/master/ScreenShots/frameworks.png)\n\n\n**Finally**, we could just use the image picker in foder `PrismaImagePicker`, this is an independent function for developer jsut want to have a image picker with Prisma's syle.\n\n**More details, please view my [blog](http://error408.com/2016/08/03/Prisma-%E6%88%90%E5%8A%9F%E7%9A%84%E4%B8%8D%E5%8F%AA%E6%98%AF%E8%89%BA%E6%9C%AF/)(*Only Chinese supported*)**\n\n\n\n### How to use PrismaImagePicker?\n\n* Create an object of class `PMImagePickerController`, and just present it from your own view controller.\n* If you just have the data source before, you can set the data source of `PMImagePickerController`, so it can be fast because without read the photo album.\n* Conform to protocol `PMImagePickerControllerDelegate`, and implement the delegate used.\n\nThe PMImagePickerControllerDelegate\n\n```swift\n@objc protocol PMImagePickerControllerDelegate: NSObjectProtocol {\n    /**\n     Call when tap `Use` button of the picker view controller\n     \n     - parameter picker: The view controller of class PMImagePickerController\n     - parameter image:  An cropped image which displayed in the top header after edit\n     */\n    optional func imagePickerController(picker: PMImagePickerController, didFinishPickingImage image: UIImage)\n    \n    /**\n     Call when tap `Use` button of the picker view controller\n     \n     - parameter picker:        The view controller of class PMImagePickerController\n     - parameter originalImage: An original image which displayed in the top header\n     - parameter selectedRect:  A rect displayed of the header\n     - parameter zoomScale:     ZoomScale of the image\n     */\n    optional func imagePickerController(picker: PMImagePickerController, didFinishPickingImage originalImage: UIImage, selectedRect: CGRect, zoomScale:CGFloat)\n    \n    /**\n     Call when tap `Cancel` button of the picker view controller\n     \n     - parameter picker: The view controller of class PMImagePickerController\n     */\n    optional func imagePickerControllerDidCancel(picker: PMImagePickerController)\n}\n```\n\n\u003cbr\u003e\nCreate and use the iamge picker\n\n```swift\n// Create image picker\n@IBAction func selectPhoto(sender: AnyObject) {\n    let nav = PMImagePickerController.init()\n    nav.pmDelegate = self\n    nav.photoGroups = photoGroups\n    nav.photoAssets = photoAssets\n    weak var weakSelf = self\n    self.presentViewController(nav, animated: true) {\n        weakSelf!.session.stopRunning()\n    }\n}\n\n\n// PMImagePickerControllerDelegate\nfunc imagePickerController(picker: PMImagePickerController, didFinishPickingImage originalImage: UIImage, selectedRect: CGRect, zoomScale:CGFloat) {\n    // Do something with the original image\n    ...\n}\n    \nfunc imagePickerController(picker: PMImagePickerController, didFinishPickingImage image: UIImage) {\n    // Dow something with the cropped image\n    ...\n}\n\nfunc imagePickerControllerDidCancel(picker: PMImagePickerController) {\n    session.startRunning()\n}\n```\n\n**Custom your own album kind**\n\nThe default album is `Camera`、`Favorites`、`ScreenShots` and `User photos`, and all the operations of image is in `PMImageManger.swift`. \n\nIf you want change the kind of album, you could change the parameters `PHAssetCollectionType` and `PHAssetCollectionSubtype` in function `class func photoLibrarys() -\u003e [PHAssetCollection]`\n\n\n# License\n\nPrismaSimpleImagePicker is available under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliangdrime%2FPrismaSimpleImagePicker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fliangdrime%2FPrismaSimpleImagePicker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliangdrime%2FPrismaSimpleImagePicker/lists"}