{"id":26704184,"url":"https://github.com/mentum/pictureflow","last_synced_at":"2025-04-13T13:34:02.747Z","repository":{"id":57452583,"uuid":"89013971","full_name":"mentum/pictureflow","owner":"mentum","description":"Image processing with a tensorflow-inspired API","archived":false,"fork":false,"pushed_at":"2024-08-30T23:51:53.000Z","size":58,"stargazers_count":5,"open_issues_count":4,"forks_count":2,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-10-10T09:31:02.714Z","etag":null,"topics":["image-processing","python3"],"latest_commit_sha":null,"homepage":null,"language":"Python","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/mentum.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-04-21T18:46:37.000Z","updated_at":"2023-11-25T03:15:33.000Z","dependencies_parsed_at":"2025-03-27T04:34:28.528Z","dependency_job_id":"539ecfda-5288-4510-8f2d-3fbd11cd1029","html_url":"https://github.com/mentum/pictureflow","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mentum%2Fpictureflow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mentum%2Fpictureflow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mentum%2Fpictureflow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mentum%2Fpictureflow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mentum","download_url":"https://codeload.github.com/mentum/pictureflow/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248721946,"owners_count":21151182,"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":["image-processing","python3"],"created_at":"2025-03-27T04:34:20.575Z","updated_at":"2025-04-13T13:34:02.717Z","avatar_url":"https://github.com/mentum.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PictureFlow\n\nPictureFlow is an image processing library that aims to simplify the way we think about modifying images. It depends on [OpenCV](http://opencv.org/) for most image manipulation tasks, altough we have plans to support more backends in the future. We currently only support Python 3.6+, but efforts to make the project compatible with 2.7+ and \u003c 3.6 are very welcome!\n\n\n\n## Installation\n\n### Via `pip`\n\n```shell\n$ pip install pictureflow\n```\n\n\n\n### Manually\n\n```shell\n$ git clone git@github.com:mentum/pictureflow.git\n$ cd pictureflow\n$ python setup.py install\n```\n\n\n\n## Example\n\n```python\nfrom pictureflow.output import DiskOutput\nfrom pictureflow.transform import ColorMask, Convert, Rotate, Scale\n\nimport cv2\nimport pictureflow as pf\n\n# Define some placeholders that will form the root of our transformation graph\nimgs = pf.Placeholder(out_type=pf.Image)\nangle = pf.Placeholder(out_type=int)\n\n# This branch will reduce the image to 20% of its original size, convert it to RGB \u0026 write it to the 'output/' directory\nbranch_a = Scale(imgs, scale_factor=pf.Constant(0.2))\nbranch_a = Convert(branch_a, src=pf.Constant('bgr'), dest=pf.Constant('rgb'))\nbranch_a = DiskOutput(branch_a, base_path=pf.Constant('output/'))\n\n# This branch will rotate the image by variable angles (fed with the session context),\n# will filter-out the red color, and will write it to the 'other/' directory.\nbranch_b = Rotate(imgs, rot_angle=angle)\nbranch_b = ColorMask(branch_b, color_mask=pf.Constant([None, None, 0]))\nbranch_b = DiskOutput(branch_b, base_path=pf.Constant('other/'))\n\n# Load images\nimage_1 = pf.Image('image_1', 'jpg', cv2.imread('pic.jpg'))\nimage_2 = pf.Image('image_2', 'jpg', cv2.imread('pic2.jpg'))\n\n# Declare a new session. (A session is basically a runtime context for a\n# previously-defined graph)\nwith pf.Session({imgs: [image_1, image_2], angle: [90, 180]}) as sess:\n    output = sess.run_sync(branch_a)\n\n    for item in sess.run(branch_b):\n        print(item.id)\n```\n\n\n\n## Requirements\n\n* Python 3.6","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmentum%2Fpictureflow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmentum%2Fpictureflow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmentum%2Fpictureflow/lists"}