Giter VIP home page Giter VIP logo

Comments (1)

bunnymatic avatar bunnymatic commented on August 15, 2024 1

I'm not an owner/maintainer here but I don't believe that is supported yet. label and caption and annotate which are all ways to get text on an image require special command processing.

The following

filename |> 
  Mogrify.open |> 
  Mogrify.custom("label","the caption") |> 
  Mogrify.custom("gravity","center") |>   
  Mogrify.custom("fill","red") |> 
  Mogrify.save(path: "out.jpg")

generates a command like this:

mogrify -label "the caption" -gravity center -size 100x100 -fill red -write out.jpg inputfile.jpg

The problem here is that -label "the caption" is the wrong format for building labels. The command really needs a command that includes label:'the label' and it can't go wherever - it has to be in the right place within the command (after all the options i think). Additionally, when you use ImageMagick to create a label or caption, it is really just generating an image with that label. To get it on top of another image you need to combine them with composite.

I think to get the support out of this library, it probably needs a couple of custom command helpers that could deal with label and composite and putting the whole thing together. If you check out the code, there is a custom method to generate a histogram which is also a command in ImageMagick that needs some custom argument construction. That might be an example of how that functionality could be added to the library.

These links (ImageMagick docs and a SO post) should give some context:

  • (ImageMagick docs on label)[https://legacy.imagemagick.org/Usage/text/#label]
  • (SO Post: imagemagick place caption on existing image)[
    https://stackoverflow.com/questions/36701114/imagemagick-place-caption-on-existing-image]

from mogrify.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.