Image processing library

Hi, I need to concatenate two images into a single one, does elixir have some library for that? or maybe erlang libraries. I need something like PIL from python world.

2 Likes

There are imagemagick and libvips wrappers.

Yes, I thought Mogrify is a suitable library, but it seems that Mogrify doesn’t have functional that i need.

It has append, composite and a bunch of other stuff?

Are you sure? I didn’t find anything like that

Those libs actually don’t have it “baked in” but you can:

a) Fork one of them and add the command yourself


You can see there that it’s basically calling System.cmd with imagemagick’s command line commands.

b) Just call yourself the commands using the same way they use in tat lib (System.cmd)
http://www.imagemagick.org/Usage/layers/#append_array

c) Figure out how to pass exactly the options to the custom function mogrify's lib has. It does accept options, so you could do that:

new_image = "a_real_path_here/to_your_new_image.jpg"
image = %Image{path: path} |> custom("here you will need to figure out how to pass all the options&flags to the command") |> save 

But I think you would be just fine using the commands themselves, the same way they are used in the lib.