Hey all! I'm new to ImageMagick and it seems like it's a great solution to a process at work that's becoming a bottleneck as we grow. I read through a bunch of documentation and found a couple of things that will assist in this, but I can't seem to find exactly what I'm looking for in terms of input.
Here's the process in full:
When we get a new customer onboarded we need to create a generic logo for them. These logos are always the same pixel dimensions and always use the same font/font color; the only thing that differs between each one is the name of the customer. This name can vary quite a bit in length, from say 6 characters all the way up to 100 or even slightly more.
Because of this name variance, the font size needs to vary so that the name of the customer fits appropriately. There also should be line breaks where appropriate. I found that a lot of this can be solved with Best Fit Labels in the ImageMagick documentation.
What I'm struggling to find is where I can have an input file -- be it a .txt or .csv -- with a list of customer names, and then ImageMagick will read that file in, and create an image for each one of those customers, taking into account the length of the name, creating a best-fit label within the pixel dimension constraints, and then output each image with a meaningful file name (for example the customer ID# or something so it can be uploaded easily).
Is it possible to do what I want without diving into something like an API? I've dabbled in Python and can use it if needed, just wanted to see if there was a simple solution that can easily be run on other machines as this won't be executed on mine.
Looking to create series of images via text/csv input
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Looking to create series of images via text/csv input
You will likely need a script to read the file and loop over each name and call imagemagick to process the name into the logo:. That script will depend upon your OS. For example a Unix shell script or a Windows bat script each can process Imagemagick command lines. So you do not need another API.
Re: Looking to create series of images via text/csv input
This got me on the right path! Thanks so much for the fast response!