{"id":17202047,"url":"https://github.com/colcarroll/imcmc","last_synced_at":"2025-10-25T14:10:15.605Z","repository":{"id":28930776,"uuid":"119762215","full_name":"ColCarroll/imcmc","owner":"ColCarroll","description":"Image Markov Chain Monte Carlo","archived":false,"fork":false,"pushed_at":"2021-11-12T01:52:35.000Z","size":37419,"stargazers_count":244,"open_issues_count":3,"forks_count":38,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-04-10T01:13:47.470Z","etag":null,"topics":[],"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/ColCarroll.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}},"created_at":"2018-02-01T00:43:31.000Z","updated_at":"2025-02-22T20:09:09.000Z","dependencies_parsed_at":"2022-07-26T04:02:03.922Z","dependency_job_id":null,"html_url":"https://github.com/ColCarroll/imcmc","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/ColCarroll%2Fimcmc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ColCarroll%2Fimcmc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ColCarroll%2Fimcmc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ColCarroll%2Fimcmc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ColCarroll","download_url":"https://codeload.github.com/ColCarroll/imcmc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248137891,"owners_count":21053775,"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":[],"created_at":"2024-10-15T02:13:29.664Z","updated_at":"2025-09-19T10:48:15.495Z","avatar_url":"https://github.com/ColCarroll.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"![imcmc](examples/imcmc.gif)\n\n[![Build Status](https://travis-ci.org/ColCarroll/imcmc.svg?branch=master)](https://travis-ci.org/ColCarroll/imcmc)\n[![Coverage Status](https://coveralls.io/repos/github/ColCarroll/imcmc/badge.svg?branch=master)](https://coveralls.io/github/ColCarroll/imcmc?branch=master)\n\n*It probably makes art.*\n\n`imcmc` (*im-sea-em-sea*) is a small library for turning 2d images into probability distributions\nand then sampling from them to create images and gifs. Right now it is best at logos and shape based images.\n\nInstallation\n------------\n\nThis is actually `pip` installable from git!\n\n```bash\npip install git+https://github.com/ColCarroll/imcmc\n```\n\nQuickstart for logos and gifs\n-----------------------------\n\nSee [imcmc.ipynb](examples/imcmc.ipynb) for a few working examples as well.\n\n```python\nimport imcmc\n\n\nimage = imcmc.load_image('python.png', 'L')\n\n# This call is random -- rerun adjusting parameters until the image looks good\ntrace = imcmc.sample_grayscale(image, samples=1000, tune=500, nchains=6)\n\n# Lots of plotting options!\nimcmc.plot_multitrace(trace, image, marker='o', markersize=10,\n                      colors=['#0000FF', '#FFFF00'], alpha=0.9);\n\n# Save as a gif, with the same arguments as above, plus some more\nimcmc.make_gif(trace, image, dpi=40, marker='o', markersize=10,\n               colors=['#0000FF', '#FFFF00'], alpha=0.9,\n               filename='example.gif')\n```\n\n![Python](examples/python.gif)\n\nQuickstart for color images\n---------------------------\n\nSee [crosshatch.ipynb](examples/crosshatch.ipynb) for a few working examples as well.\n\n```python\nimport matplotlib.pyplot as plt\n\nfrom imcmc.color import (\n    ImageLines,\n    IntensityMCMCStrategy,\n    UniformLinesStrategy,\n    GibbsIntensityStrategy\n)\n\npete = plt.imread('color/pete2.jpg')\n\nImageLines(pete, UniformStrategy()).plot()\n```\n\n![pete](examples/pete.jpg)\n\n```python\nmunchen = plt.imread('color/munchen.jpg')\n\nImageLines(munchen, IntensityMCMCStrategy(step_size=500)).plot(10_000)\n```\n\n![munchen](examples/munchen.jpg)\n\n```python\nbeach = plt.imread('color/beach.jpg')\n\nImageLines(beach, UniformLinesStrategy()).plot(1500, linewidth=1)\n```\n\n![beach](examples/beach.jpg)\n\n```python\nkarwendel = plt.imread('color/karwendel.jpg')\n\nImageLines(karwendel, GibbsIntensityStrategy()).plot(1_000)\n```\n\n![karwendel](examples/karwendel.jpg)\n\nBuilt with\n----------\n\n`Pillow` does not have a logo, but the other tools do!\n\n![PyMC3](examples/pymc3.gif)\n\n![matplotlib](examples/matplotlib.gif)\n\n![scipy](examples/scipy.gif)\n\n![Python](examples/python.gif)\n\nHere's a tricky one whose support I appreciate\n----------------------------------------------\n\nI get to do lots of open source work for [The Center for Civic Media](https://civic.mit.edu/) at\nMIT. Even better, they have a super multi-modal logo that I needed to use 98 chains to sample from!\n\n![Center for Civic Media](examples/civic.gif)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcolcarroll%2Fimcmc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcolcarroll%2Fimcmc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcolcarroll%2Fimcmc/lists"}