For some versions of IM, "label:" can do automatic pointsizing. Otherwise, a two-step solution can be used. Windows script:
Code: Select all
FOR /F "tokens=1,2" %%i IN ('%IM%identify -format "%%[fx:min(w,h)*0.17]" %INFILE%') DO (
set POINT=%%i
)
"%IMG%convert" ^
%INFILE% ^
-density 72 -colorspace RGB -weight bold ^
-pointsize %POINT% ^
-draw "gravity center fill '#FF0000' rotate 315 text 0,0 'Some Text'" ^
outputFile.jpg
The "0.17" is a fiddle factor that works with "Some Text". It should be adjusted if the text is longer or shorter.
EDIT: I meant "label:", not "-label".