{"id":13508381,"url":"https://github.com/elixir-mogrify/mogrify","last_synced_at":"2025-12-17T22:33:27.342Z","repository":{"id":21324291,"uuid":"24640969","full_name":"elixir-mogrify/mogrify","owner":"elixir-mogrify","description":"Image processing in Elixir (ImageMagick command line wrapper)","archived":false,"fork":false,"pushed_at":"2023-05-30T11:45:07.000Z","size":264,"stargazers_count":574,"open_issues_count":9,"forks_count":64,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-03-22T04:02:12.431Z","etag":null,"topics":["elixir","imagemagick","mogrify","wrapper"],"latest_commit_sha":null,"homepage":"","language":"Elixir","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/elixir-mogrify.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2014-09-30T14:19:59.000Z","updated_at":"2025-03-18T05:11:11.000Z","dependencies_parsed_at":"2023-02-10T23:15:21.507Z","dependency_job_id":"1883b0cf-c437-438c-b1cd-04b21fcef1c4","html_url":"https://github.com/elixir-mogrify/mogrify","commit_stats":{"total_commits":169,"total_committers":27,"mean_commits":"6.2592592592592595","dds":0.3668639053254438,"last_synced_commit":"f495f05e2f71403d5a5e59bf4bbc52e0036eb742"},"previous_names":["route/mogrify"],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elixir-mogrify%2Fmogrify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elixir-mogrify%2Fmogrify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elixir-mogrify%2Fmogrify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elixir-mogrify%2Fmogrify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elixir-mogrify","download_url":"https://codeload.github.com/elixir-mogrify/mogrify/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246314011,"owners_count":20757450,"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":["elixir","imagemagick","mogrify","wrapper"],"created_at":"2024-08-01T02:00:52.301Z","updated_at":"2025-10-21T14:42:45.281Z","avatar_url":"https://github.com/elixir-mogrify.png","language":"Elixir","funding_links":[],"categories":["Images","Elixir","elixir"],"sub_categories":[],"readme":"# Mogrify\n\n[![Build Status](https://github.com/elixir-mogrify/mogrify/actions/workflows/ci.yml/badge.svg)](https://github.com/elixir-mogrify/mogrify/actions?query=workflow%3ACI)\n[![Module Version](https://img.shields.io/hexpm/v/mogrify.svg)](https://hex.pm/packages/mogrify)\n[![Hex Docs](https://img.shields.io/badge/hex-docs-lightgreen.svg)](https://hexdocs.pm/mogrify/)\n[![Total Download](https://img.shields.io/hexpm/dt/mogrify.svg)](https://hex.pm/packages/mogrify)\n[![License](https://img.shields.io/hexpm/l/mogrify.svg)](https://github.com/elixir-mogrify/mogrify/blob/master/LICENSE.md)\n[![Last Updated](https://img.shields.io/github/last-commit/elixir-mogrify/mogrify.svg)](https://github.com/elixir-mogrify/mogrify/commits/master)\n\nAn Elixir wrapper for ImageMagick command line.\n\nDocumentation: https://hexdocs.pm/mogrify/\n\n## Requirements\n\nYou must have ImageMagick installed of course.\n\n## Installation\n\nAdd this to your `mix.exs` file, then run `mix do deps.get, deps.compile`:\n\n```elixir\ndef deps do\n  {:mogrify, \"~\u003e 0.9.3\"}\nend\n```\n\n## Configuration\n\nConfigure the ImageMagick executable paths (optional):\n\nConfigure `mogrify` command:\n\n```elixir\nconfig :mogrify, mogrify_command: [\n  path: \"magick\",\n  args: [\"mogrify\"]\n]\n```\n\nConfigure `convert` command:\n\n```elixir\nconfig :mogrify, convert_command: [\n  path: \"magick\",\n  args: [\"convert\"]\n]\n```\n\nConfigure `identify` command:\n\n```elixir\nconfig :mogrify, identify_command: [\n  path: \"magick\",\n  args: [\"identify\"]\n]\n```\n\n\n## Examples\n\nThumbnailing:\n\n```elixir\nimport Mogrify\n\n# This does operations on an original image:\nopen(\"input.jpg\") |\u003e resize(\"100x100\") |\u003e save(in_place: true)\n\n# save/1 creates a copy of the file by default:\nimage = open(\"input.jpg\") |\u003e resize(\"100x100\") |\u003e save\nIO.inspect(image) # =\u003e %Image{path: \"/tmp/260199-input.jpg\", ext: \".jpg\", ...}\n\n# Resize to fill\nopen(\"input.jpg\") |\u003e resize_to_fill(\"450x300\") |\u003e save\n\n# Resize to limit\nopen(\"input.jpg\") |\u003e resize_to_limit(\"200x200\") |\u003e save\n\n# Extent\nopen(\"input.jpg\") |\u003e extent(\"500x500\") |\u003e save\n\n# Gravity\nopen(\"input.jpg\") |\u003e gravity(\"Center\") |\u003e save\n```\n\nConverting:\n\n```elixir\nimport Mogrify\n\nimage = open(\"input.jpg\") |\u003e format(\"png\") |\u003e save\nIO.inspect(image) # =\u003e %Image{path: \"/tmp/568550-input.png\", ext: \".png\", format: \"png\"}\n```\n\nGetting info:\n\n```elixir\nimport Mogrify\n\nimage = open(\"input.jpg\") |\u003e verbose\nIO.inspect(image) # =\u003e %Image{path: \"input.jpg\", ext: \".jpg\", format: \"jpeg\", height: 292, width: 300}\n```\n\nGetting reduced info in a \"lighter\" way (uses less memory):\n\n```elixir\nimport Mogrify\n\ninfo = identify(\"input.jpg\")\nIO.inspect(info) # =\u003e %{format: \"jpeg\", height: 292, width: 300}\n```\n\nUsing custom commands to create an image with markup:\n\n```elixir\nimport Mogrify\n\n%Mogrify.Image{path: \"test.png\", ext: \"png\"}\n|\u003e custom(\"size\", \"280x280\")\n|\u003e custom(\"background\", \"#000000\")\n|\u003e custom(\"gravity\", \"center\")\n|\u003e custom(\"fill\", \"white\")\n|\u003e custom(\"font\", \"DejaVu-Sans-Mono-Bold\")\n|\u003e custom(\"pango\", ~S(\u003cspan foreground=\"yellow\"\u003ehello markup world\u003c/span\u003e))\n|\u003e create(path: \".\")\n```\n\nPlasma backgrounds:\n\n```elixir\nimport Mogrify\n\n%Mogrify.Image{path: \"test.png\", ext: \"png\"}\n|\u003e custom(\"size\", \"280x280\")\n|\u003e custom(\"seed\", 10)\n|\u003e custom(\"plasma\", \"fractal\")\n```\n\nCreating new images: See [mogrify_draw](https://github.com/zamith/mogrify_draw) for an example of generating a new image from scratch.\n\n## Changelog\n\nSee the [changelog](./CHANGELOG.md) for important release notes between Mogrify versions.\n\n## Copyright and License\n\nCopyright (c) 2014 Dmitry Vorotilin\n\nMogrify source code is licensed under the [MIT License](./LICENSE.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felixir-mogrify%2Fmogrify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felixir-mogrify%2Fmogrify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felixir-mogrify%2Fmogrify/lists"}