Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Automate adding text into a PNG
#2
I am no script writer, I am sure there will be one along soon.  
To put this in the scripts section or the 'old Gimp' section ? That is the question. I think old Gimp since there might be limitations.

First, Using Gimp 2.8 but what version of Linux? it can make a difference for the next suggestion.

For a bash script the utility ImageMagick (IM) http://www.imagemagick.org might be more appropriate. There will be a version in your linux repo, probably version 6  If you can get the static compiled version 'magick' working then that is version 7 and gives more options.

Next your .xcf file. Gimp 2.8 is different to Gimp 2.10 If multiple layers then it needs flattening. That can be a problem with IM6 but not IM7.

Quote:...snip...Next, with a simple bash script, I would easily have the correct date/time stamp and proper version number information automatically available from other parts of the project.
I am seeking assistance in how to automate using GIMP, via Linux, in a strictly scripted fashion to automatically open the MASTER image, insert a new text box with the correct 3 lines of information at the specified coordinates, and then simply export the completed image as a PNG with a newly chosen name (as identified in the copy operation earlier)....snip...

As a example what might go in a bash file.

Code:
magick(or convert)  some.xcf -flatten temp.miff
magick(or convert)  temp.miff  -fill white -undercolor '#00770080' -gravity South -pointsize 40 -annotate +0+5 @text.txt newfile.png

and that renders the contents of text.txt at a particular place on newfile.png  IM6 uses convert in place of IM7 magick command.  miff is IM own format, you could use any other supported format.

The IM forum https://github.com/ImageMagick/ImageMagick/discussions is always a good place to ask questions.
Reply


Messages In This Thread
Automate adding text into a PNG - by Joe_Wulf - 10-27-2022, 02:15 AM
RE: Automate adding text into a PNG - by rich2005 - 10-27-2022, 11:31 AM
RE: Automate adding text into a PNG - by Joe_Wulf - 10-27-2022, 06:07 PM
RE: Automate adding text into a PNG - by rich2005 - 10-28-2022, 09:03 AM
RE: Automate adding text into a PNG - by Joe_Wulf - 11-08-2022, 09:05 PM

Forum Jump: