{"id":13880136,"url":"https://github.com/mceachen/micro_magick","last_synced_at":"2025-07-16T16:31:12.664Z","repository":{"id":2607311,"uuid":"3590670","full_name":"mceachen/micro_magick","owner":"mceachen","description":"Simplest correct ImageMagick/GraphicsMagick ruby wrapper","archived":true,"fork":false,"pushed_at":"2017-12-08T06:02:17.000Z","size":510,"stargazers_count":29,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-13T11:53:35.195Z","etag":null,"topics":["graphicsmagick","image","image-processing","imagemagick","images","photo","photo-editing","photographs","photography","photos","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/mceachen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-03-01T09:38:38.000Z","updated_at":"2023-01-28T20:51:44.000Z","dependencies_parsed_at":"2022-08-20T13:10:42.013Z","dependency_job_id":null,"html_url":"https://github.com/mceachen/micro_magick","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/mceachen/micro_magick","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mceachen%2Fmicro_magick","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mceachen%2Fmicro_magick/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mceachen%2Fmicro_magick/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mceachen%2Fmicro_magick/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mceachen","download_url":"https://codeload.github.com/mceachen/micro_magick/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mceachen%2Fmicro_magick/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265524629,"owners_count":23782015,"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":["graphicsmagick","image","image-processing","imagemagick","images","photo","photo-editing","photographs","photography","photos","ruby"],"created_at":"2024-08-06T08:02:48.621Z","updated_at":"2025-07-16T16:31:12.331Z","avatar_url":"https://github.com/mceachen.png","language":"Ruby","funding_links":[],"categories":["Ruby"],"sub_categories":[],"readme":"# Simple, efficient \\*Magick rubygem\n\n[![Gem Version](https://badge.fury.io/rb/micro_magick.svg)](http://rubygems.org/gems/micro_magick)\n[![Build Status](https://secure.travis-ci.org/mceachen/micro_magick.svg)](http://travis-ci.org/mceachen/micro_magick)\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/5addbc91244e496ab959aa80492c545d)](https://www.codacy.com/app/matthew-github/micro_magick)\n[![Dependency Status](https://gemnasium.com/mceachen/micro_magick.svg)](https://gemnasium.com/mceachen/micro_magick)\n\n## Features\n\nMicroMagick lets you use [ImageMagick](http://www.imagemagick.org/) or\n[GraphicsMagick](http://www.graphicsmagick.org/) from ruby.\n\nUsing MicroMagick:\n\n* doesn't bloat your ruby process when you process large images (like `rmagick`)\n* supports valid geometry specifications, like `640x480\u003e` (which doesn't work\n  with `mini_magick` and `quick_magick`)\n* doesn't create unnecessary tempfiles (like `mini_magick`)\n* doesn't assume you only needed to resize your images (like `imagery`)\n* supports identification of corrupt images (which is unique to MicroMagick).\n  (Note that this support wasn't added to ImageMagick until version 6.7.0, but\n  has been present in GraphicsMagick for several years).\n\nMicroMagick has excellent\n[test coverage](http://travis-ci.org/mceachen/micro_magick) and\n[code quality](https://codeclimate.com/github/mceachen/micro_magick).\n\n## Usage\n\n```ruby\nimg = MicroMagick::Image.new(\"/path/to/image.jpg\")\nimg.strip.quality(85).resize(\"640x480\u003e\").write(\"640x480.jpg\") unless img.corrupt?\n```\n\nThis will\n\n1. Read `/path/to/image.jpg`\n1. Verify the image is not corrupt, using `identify`\n1. Set up a `convert` command to\n\n   * remove EXIF headers (`strip`),\n   * use 85% JPEG quality,\n   * resize to 640x480 only if the source image is bigger than those dimensions\n     (hence the '\u003e' suffix)\n   * write the results to '640x480.jpg'\n\nThis results in the following system call:\n\n`gm convert -size 640x480 /path/to/image.jpg +profile \\* -quality 85 -resize\n\"640x480\u003e\" /new/path/image-640x480.jpg`\n\nTo get image dimensions:\n\n```ruby\nimg.width\n# =\u003e 3264\nimg.height\n# =\u003e 2448\n```\n\n### What about EXIF information?\n\nTo access EXIF metadata information, including properly typed values, see the\n[exiftool](https://github.com/mceachen/exiftool) and\n[exiftool_vendored](https://github.com/mceachen/exiftool_vendored) gems.\n\n### Installation\n\nAdd `gem 'micro_magick'` to your `Gemfile` and run `bundle`.\n\nYou'll also need to\n[install GraphicsMagick](http://www.graphicsmagick.org/README.html).\n\nIf you're on a Mac with [homebrew](http://brew.sh/), `brew install\ngraphicsmagick`.\n\n### \"Plus\" options\n\nTo add an output option that has a \"plus\" prefix, like, `+matte`, use\n`.add_output_option(\"+matte\")`.\n\n### Goodies\n\nThere are a couple additional methods that have been added to address common\nimage tasks:\n\n* `img.strip` removes all comments and EXIF headers\n* `img.square_crop` crops the image to a square (so a 640x480 image would crop\n  down to a 480x480 image, cropped in the middle).\n\nNote that `micro_magick` delegates all parameter validation to the underlying\nlibrary. A `MicroMagick::ArgumentError` will be raised on `.write` or\n`.overwrite` if ImageMagick or GraphicsMagick writes anything to stderr.\n\n## GraphicsMagick versus ImageMagick\n\n_At least in my testing, GraphicsMagick blows ImageMagick out of the water._\n\nIn resizing a 2248x4000 image to 640x480:\n\n* GraphicsMagick takes ~140 milliseconds. ImageMagick takes ~550 millis.\n* GraphicsMagick outputs a 37K JPG, ImageMagick outputs a 94K JPG, with no\n  detectable visual differences.\n\nNot only is GraphicsMagick 4 times faster, it produces 2.5x smaller output with\nthe same quality--WIN WIN.\n\nBecause of this, if you have GraphicsMagick installed, MicroMagick will use it\nby default. You can force which library to use with the\n`MicroMagick.use_graphicsmagick!` and `MicroMagick.use_imagemagick!` methods.\n\nTo see which external library and version you're using:\n\n```ruby\nMicroMagick.version\n=\u003e #\u003cGem::Version \"1.3.21\"\u003e\nMicroMagick.imagemagick?\n=\u003e false\nMicroMagick.graphicsmagick?\n=\u003e true\n```\n\n## Changelog\n\n### 1.1.0\n\n* Allow supplying input file options. Thanks,\n  [whitequark](https://twitter.com/whitequark/)!\n\n### 1.0.1\n\nAdded explicit MIT licensing.\n\n### 1.0.0\n\nPlease note that the attributes hash associated to images has been removed in\nthis version, in the interests of correctness. If you need EXIF metadata, use\nthe [exiftool](https://github.com/mceachen/exiftool) gem.\n\n* Updated identity parsing to only dimensions. Addresses\n  [Issue 3](https://github.com/mceachen/micro_magick/issues/3) (multi-value),\n  and [Issue 5](https://github.com/mceachen/micro_magick/issues/5) (NULL\n  bytestreams)\n* Updated Travis configuration\n\n### 0.0.7\n\n* There's only one common Image class now\n* Added `identify -verbose` parsing\n* Added support for mogrify with new `.overwrite` method\n\n### 0.0.6\n\nCleaned up some packaging/mode bit issues\n\n### 0.0.5\n\nFixed gemspec metadata\n\n### 0.0.4\n\nInput file -size render hint is now only used with simple dimension\nspecifications\n\n### 0.0.3\n\nAdded square_crop, image dimensions, and support for `+option`s.\n\n### 0.0.1\n\nLet's get this party started.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmceachen%2Fmicro_magick","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmceachen%2Fmicro_magick","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmceachen%2Fmicro_magick/lists"}