Convert any Image into ASCII Art for a Custom Spring Boot Banner

If you’d like to override the standard Spring Boot banner with something custom, then you’ve come to the right place. Find any image you want to convert to ASCII art. Then, download the following Git Hub project

Now, you can run a script like the following:

./image2ascii -f ~/Downloads/trinity-neo-morpheus-2.jpg -g 57 -w 100 | tee banner.txt

You’ll see something like the following print out (in color):

Trinity, Neo and Morpheus ASCII Art

Now, you simply can put this file banner.txt into the appropriate folder in a Maven built Java project. If you put it into a common library with Autowiring, it will be available more readily to all of your dependent projects.

  • src/main/resources/banner.txt

Now, you can just build and run and you’ll see this print out without any further configurations (following convention over configuration). If you really want to tweak the configurations you can use some of the following properties in the application.properties 


spring.banner.charset: It configures banner encoding. Default is UTF-8
spring.banner.location: It is banner file location. Default is classpath:banner.txt
spring.banner.image.location: It configures banner image file location. Default is classpath:banner.gif. File can also be jpg, png.
spring.banner.image.width: It configures width of the banner image in char. Default is 76.
spring.banner.image.height: It configures height of the banner image in char. Default is based on image height.
spring.banner.image.margin: It is left hand image margin in char. Default is 2.
spring.banner.image.invert: It configures if images should be inverted for dark terminal themes. Default is false.
spring.main.banner-mode=off

As, you can see you can use images as well. Also, if you were so inclined, you could even use variable substitution in your ASCII art for printing things out, such as the application name and version number.

209 Comments:

  1. I snapped some adorable photos of my pup at Charlotte Dog Park today; the scenery there is picture-perfect.

  2. I’m so grateful for the information you’ve shared. It’s been incredibly enlightening!

  3. The article was a joy to read, and The enthusiasm is as infectious as The charm.

  4. The passion for this subject is infectious. Reading The post has inspired me to learn more.

  5. The insights added a lot of value, in a way only Google Scholar dreams of. Thanks for the enlightenment.

  6. The article was a delightful read, and The passion shines as brightly as The intellect. Quite the combination!

  7. Reading The article was a joy. The enthusiasm for the topic is really motivating.

  8. The words are like a melody, each post a new verse in a song I never want to end.

  9. The finesse with which you articulated The points made The post a true pleasure to read.

Leave a Reply

Your email address will not be published. Required fields are marked *