{"id":20207951,"url":"https://github.com/thearchitector/smartclip","last_synced_at":"2025-11-30T01:05:19.354Z","repository":{"id":108445750,"uuid":"100874364","full_name":"thearchitector/Smartclip","owner":"thearchitector","description":"A contextually-aware paperclip processor that crops and scales your images to maximize aesthetic quality","archived":false,"fork":false,"pushed_at":"2018-05-30T15:39:06.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-03T10:15:21.806Z","etag":null,"topics":["algorithm","image","image-processing","paperclip","paperclip-processor"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thearchitector.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":"2017-08-20T16:31:58.000Z","updated_at":"2018-05-30T15:39:08.000Z","dependencies_parsed_at":null,"dependency_job_id":"ba87fa22-d4d5-429a-b59f-a2f996e2e29c","html_url":"https://github.com/thearchitector/Smartclip","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/thearchitector/Smartclip","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thearchitector%2FSmartclip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thearchitector%2FSmartclip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thearchitector%2FSmartclip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thearchitector%2FSmartclip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thearchitector","download_url":"https://codeload.github.com/thearchitector/Smartclip/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thearchitector%2FSmartclip/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":283927426,"owners_count":26917952,"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","status":"online","status_checked_at":"2025-11-11T02:00:06.610Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["algorithm","image","image-processing","paperclip","paperclip-processor"],"created_at":"2024-11-14T05:33:32.551Z","updated_at":"2025-11-11T20:36:00.450Z","avatar_url":"https://github.com/thearchitector.png","language":"Ruby","readme":"\u003cimg src=\"/smartclip.svg\" width=\"128\"\u003e\n\n# Smartclip\nSmartclip is a contextually-aware paperclip processor that crops and scales your images to maximize aesthetic quality.\n\n\u003e While initially written as a passion project for [The Glass Files](https://www.theglassfiles.com/), I've abstracted away all the hardcoded specifics so it should work generically. Images smaller than the desired thumbnail size are automatically padded with a border rather than being enlarged.\n\n## The Algorithm \nThe algorithm is fairly simple and is an adjusted a port of [smartcrop.js](https://github.com/jwagner/smartcrop.js) by Jonas Wagner:\n  * Find edges\n  * Find regions with a color like skin\n  * Find regions high in saturation\n  * Generate a set of thumbnail candidates\n  * Rank candidates using an importance function to focus the detail in the center and avoid it in the edges.\n  * The highest ranking candidate is selected and is processed by Paperclip\n\n## Example\nThe process is super simple, and is basically identical to using any other Paperclip processor:\n\n  ```ruby\n    # Your path might be different, so adjust as necessary\n    require \"#{Rails.root}/lib/paperclip_processors/smartclip\"\n    \n    ...\n\n    styles: { thumb: { resize_width: 150, resize_height: 150, processors: [:smartclip] } }\n  ```\n\n## Future Plans\n  * Wrap within gem for easy installation\n  * Optimize pixel iteration to reduce number of loops. Can it be done without screwing with saliency patterns?\n  * Port and integrate face detection algorithm\n  * Completely rewrite to favor deep neural networks? Benefits from more complicated criteria, and can be trained from professional data rather than guesses\n  * _Extract optimzation logic, along with what I've learned, to create separate image optmization processor?_\n\n## Found Bugs?\nIf you found a bug, submit an issue. If you have some optimization insight, submit a Pull Request.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthearchitector%2Fsmartclip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthearchitector%2Fsmartclip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthearchitector%2Fsmartclip/lists"}