{"id":18838788,"url":"https://github.com/starkdmi/swiftorientcrop","last_synced_at":"2026-01-28T14:30:16.790Z","repository":{"id":190453040,"uuid":"682657934","full_name":"starkdmi/SwiftOrientCrop","owner":"starkdmi","description":"Working with oriented images in Swift","archived":false,"fork":false,"pushed_at":"2023-08-26T16:34:00.000Z","size":38146,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-30T09:14:39.057Z","etag":null,"topics":["cgimage","ciimage","crop-image","image-manipulation","image-processing","swift","vimage"],"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/starkdmi.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-24T16:36:44.000Z","updated_at":"2024-01-07T20:51:52.000Z","dependencies_parsed_at":"2024-11-08T02:40:53.620Z","dependency_job_id":"19126f9b-bf12-4851-b5fc-2b77e0f7eb01","html_url":"https://github.com/starkdmi/SwiftOrientCrop","commit_stats":null,"previous_names":["starkdmi/swiftorientcrop"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/starkdmi%2FSwiftOrientCrop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/starkdmi%2FSwiftOrientCrop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/starkdmi%2FSwiftOrientCrop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/starkdmi%2FSwiftOrientCrop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/starkdmi","download_url":"https://codeload.github.com/starkdmi/SwiftOrientCrop/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239774335,"owners_count":19694700,"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":["cgimage","ciimage","crop-image","image-manipulation","image-processing","swift","vimage"],"created_at":"2024-11-08T02:40:43.969Z","updated_at":"2026-01-28T14:30:16.745Z","avatar_url":"https://github.com/starkdmi.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SwiftOrientCrop\n\nProject content:\n- Oriented image generator\n- Load and orient CGImage and CIImage\n- Orient CGRect based on image orientation\n- Crop CGImage, CIImage and vImage\n- Benchmarks\n\nCode located in [Tests](SwiftOrientCropTests/SwiftOrientCropTests.swift).\n\n## Oriented image generator\n\nThose images looks the same when correctly displayed, but under the hood they pretty different.\n\n| \u003cimg src='SwiftOrientCropTests/media/iphone_x_1.jpg'/\u003e | \u003cimg src='SwiftOrientCropTests/media/iphone_x_2.jpg'/\u003e | \u003cimg src='SwiftOrientCropTests/media/iphone_x_3.jpg'/\u003e |\n| --- | --- | --- |\n| \u003cimg src='SwiftOrientCropTests/media/iphone_x_4.jpg'/\u003e | \u003cimg src='SwiftOrientCropTests/media/iphone_x_5.jpg'/\u003e | \u003cimg src='SwiftOrientCropTests/media/iphone_x_6.jpg'/\u003e |\n| \u003cimg src='SwiftOrientCropTests/media/iphone_x_7.jpg'/\u003e | \u003cimg src='SwiftOrientCropTests/media/iphone_x_8.jpg'/\u003e| |\n\n### Usage\n```Swift\ntry OrientedGenerator.generateFrom(\n  source: sourceImageFile,\n  destination: destinationDirectory,\n  format: .jpeg,\n  size: CGSize(width: 1280, height: 1280),\n  quality: 0.75\n)\n```\n\n## Image Crop Benchmarks\n\nOne call equals to loading 8 images, crop them and write image data to \nfile. Full execution is 10 single calls - 80 images in summary.\n\n| Method | Full Execution Time (seconds) | Average Execution Time per call (seconds) | Average CPU Time (seconds) | Memory Usage (kB) | Memory Peak Physical (MB) | Disk Writes (MB) | CPU Usage (% relative to CGImage) |\n|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|\n| CGImage | 38.719 | 6.372 | 5.365 | 101.6 | __11.6__ | 9.0 | 100% |\n| CIImage | __14.432__ | __2.352__ | __1.344__ | 62.3 | 15.0 | 10.9 | 29.3% |\n| vImage (CG)\\* | 31.458 | 5.186 | 5.162 | __55.7__ | __11.7__ | 9.0 | __23.8%__ |\n| vImage (CI)\\* | 30.431 | 4.933 | 4.445 | - | 15.4 | 11.0 | 28.8% |\n\n\\* vImage doesn't have API to load and save image files, so the CGImage and CIImage was used for it.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstarkdmi%2Fswiftorientcrop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstarkdmi%2Fswiftorientcrop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstarkdmi%2Fswiftorientcrop/lists"}