Friday, August 10, 2018

how to convert text file into png using imagemagick

# disable policy "path" at /etc/ImageMagick-6/policy.xml

then

convert -trim +repage -font FreeMono -size 1200x1200 -border 2 \
-pointsize 18 label:@trip_itinerary trip_itinerary.png

You may want to adjust the number 1200x1200 to be something bigger as needed which depends on the size of your input text file (trip_itinerary in this example).