Created
June 19, 2019 13:58
-
-
Save shunn/68ae0c2d3d43993a3812e519a9a7aab4 to your computer and use it in GitHub Desktop.
Name Tag Generator Part 5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create a mask (or stencil) image using the desired text | |
my $mask = Image::Magick->new; # Create a new image object | |
$mask->Set( size => '503x339' ); # Same size as blank name tag image | |
$mask->ReadImage( 'canvas:black' ); # Fill the image with black | |
$mask->Annotate( # Render the text on the image in white | |
font => $font, | |
pointsize => $size, | |
fill => 'white', | |
text => $name, | |
x => $x, | |
y => $y, | |
antialias => true, | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment