This ImageMagick command is in Windows CLI syntax, and uses IMv7 emulating v6 with "convert"...
magick convert input.png ^
-background none -bordercolor none -size 1000x1000 -fill red -gravity center ^
( label:REGISTERED -rotate -45 -trim -border 10% +repage ) ^
-set option:distort:viewport "%[fx:u.w]x%[fx:u.h]" ^
-distort SRT "%[fx:s.w/2],%[fx:s.h/2] %[fx:t?min(u.w,u.h)/min(v.w,v.h):1] 0 %[fx:u.w/2],%[fx:u.h/2]" ^
-composite result.png
The command first reads in the input image. Then in parentheses it creates a label containing the text on a transparent background, in a size larger than your largest expected input image. It rotates the label 45 degrees, trims it, and adds a transparent border to increase the dimensions by 10%.
After the parentheses it sets a viewport size to the dimensions of the input image. Then using a -distort SRT
operation, it resizes the label to fit inside the dimensions of the input image without affecting the size of input image.
After resizing the label, it is simply composited centered onto the input image.
This should accept nearly any size input image, and create and size a label as necessary to fit. Adjust the border width to provide more or less free space around the label.
To run this with IMv6, omit "magick" from the beginning of the command. To make it work on a *nix OS, change all the continued-line carets "^" to backslashes "\", and escape the parentheses around the "label" line with backslashes "\(...\)". I haven't tested it on a *nix shell, but that should work to convert the command.