2

Good morning all...

I am wondering if there is a way to automate export of an image that will have a variation for each state, where the only thing that changes on the image is the text layer that includes the name of the state, using a simple text file that lists all of the possible word variations.

I know the sample in the example is small, I'm just trying to find a solution that I can use on lists where the variations are measured in the thousands.

Thanks!

  • one possible solution (albeit the thread looks a bit old) – Scribblemacher Dec 1 '16 at 14:08
  • What software are you using for this? – Silly-V Dec 1 '16 at 21:42
  • I am using GIMP. I got a script running that does this, but the font sizing solution is a hack. I have established a character string length default, and any time a word is processed that has more characters than the default string, I reduce the font size by a provided font reduction value. – Brian Slevin Dec 5 '16 at 14:02
0

Gimp is overkill for this. There are plenty of ways to do this in the command line using a script based on ImageMagick.

If you have a file with the list of labels producing the script is a mere matter of passing a few global editor commands to change each line into a command that adds the label to the source image.

  • Thanks, I will look into it. I am doing this for graphic design, so I am working at a very high resolution. I need access to the font vectors, which Is why I was trying to get it done in GIMP. I got a script running that does resolve the problem as I described it, but the font sizing solution is a hack. I have established a character string length default, and any time a word is processed that has more characters than the default string, I reduce the font size by a provided font reduction value. This obviously doesn't work because some letters are way wider than others... – Brian Slevin Dec 5 '16 at 14:04
  • See second answer then... – xenoid Dec 5 '16 at 20:52
0

If you want to adjust font size:

ImageMagick:

You can use IM's convert to produce the label, measure it (see IM's identify utility) and if it's too big interpolate a better font size and retry. Once you have the label you use IM's compose to put the label over the picture.

GIMP:

In a Gimp script you can do the same, using the width of the generated text layer. An alternative is to produce the path/vectors from the text, and scale it to the required size and then select/fill it. But text at size 15 is not 3/4 of the font at size 20, there are subtleties, so iterating the font size will likely give better results.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.