mogrify alternatives and similar packages
Based on the "Images" category.
Alternatively, view mogrify alternatives based on common mentions on social networks and blogs.
-
cloudex
An elixir library which helps with uploading image files or urls to cloudinary -
ex_image_info
ExImageInfo is an Elixir library to parse images (binaries) and get the dimensions (size), detected mime-type and overall validity for a set of image formats. It is the fastest and supports multiple formats. -
exexif
Pure elixir library to extract tiff and exif metadata from jpeg files -
png
A pure Erlang library for creating PNG images. It can currently create 8 and 16 bit RGB, RGB with alpha, indexed, grayscale and grayscale with alpha images. -
thumbnex
Elixir library to create thumbnails from images and video screenshots. -
eikon
Eikōn is an Elixir library providing a read-only interface for image files. -
gi
Gi is a library for manipulating Graphics Interfacing. Use utility mogrify, identify, ... of GraphicsMagick to resize, draw on base images....
Learn Elixir in as little as 12 Weeks
Do you think we are missing an alternative of mogrify or a related project?
Popular Comparisons
README
Mogrify
An Elixir wrapper for ImageMagick command line.
Documentation: https://hexdocs.pm/mogrify/
Requirements
You must have ImageMagick installed of course.
Installation
Add this to your mix.exs
file, then run mix do deps.get, deps.compile
:
def deps do
{:mogrify, "~> 0.9.2"}
end
Configuration
Configure the ImageMagick executable paths (optional):
Configure mogrify
command:
config :mogrify, mogrify_command: [
path: "magick",
args: ["mogrify"]
]
Configure convert
command:
config :mogrify, convert_command: [
path: "magick",
args: ["convert"]
]
Configure identify
command:
config :mogrify, identify_command: [
path: "magick",
args: ["identify"]
]
Examples
Thumbnailing:
import Mogrify
# This does operations on an original image:
open("input.jpg") |> resize("100x100") |> save(in_place: true)
# save/1 creates a copy of the file by default:
image = open("input.jpg") |> resize("100x100") |> save
IO.inspect(image) # => %Image{path: "/tmp/260199-input.jpg", ext: ".jpg", ...}
# Resize to fill
open("input.jpg") |> resize_to_fill("450x300") |> save
# Resize to limit
open("input.jpg") |> resize_to_limit("200x200") |> save
# Extent
open("input.jpg") |> extent("500x500") |> save
# Gravity
open("input.jpg") |> gravity("Center") |> save
Converting:
import Mogrify
image = open("input.jpg") |> format("png") |> save
IO.inspect(image) # => %Image{path: "/tmp/568550-input.png", ext: ".png", format: "png"}
Getting info:
import Mogrify
image = open("input.jpg") |> verbose
IO.inspect(image) # => %Image{path: "input.jpg", ext: ".jpg", format: "jpeg", height: 292, width: 300}
Getting reduced info in a "lighter" way (uses less memory):
import Mogrify
info = identify("input.jpg")
IO.inspect(info) # => %{format: "jpeg", height: 292, width: 300}
Using custom commands to create an image with markup:
import Mogrify
%Mogrify.Image{path: "test.png", ext: "png"}
|> custom("size", "280x280")
|> custom("background", "#000000")
|> custom("gravity", "center")
|> custom("fill", "white")
|> custom("font", "DejaVu-Sans-Mono-Bold")
|> custom("pango", ~S(<span foreground="yellow">hello markup world</span>))
|> create(path: ".")
Plasma backgrounds:
import Mogrify
%Mogrify.Image{path: "test.png", ext: "png"}
|> custom("size", "280x280")
|> custom("seed", 10)
|> custom("plasma", "fractal")
Creating new images: See mogrify_draw for an example of generating a new image from scratch.
Changelog
See the [changelog](./CHANGELOG.md) for important release notes between Mogrify versions.
Copyright and License
Copyright (c) 2014 Dmitry Vorotilin
Mogrify source code is licensed under the [MIT License](./LICENSE.md).
*Note that all licence references and agreements mentioned in the mogrify README section above
are relevant to that project's source code only.