-
Notifications
You must be signed in to change notification settings - Fork 41.3k
Ascii art banner generated from an image #4647
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Add new ImageBanner class that generates ascii art with color based on an image file (banner.gif, banner.jpg or banner.png). There are configuration settings that go along with this: - banner.image.dark: whether to invert image for a dark background. (default is false). - banner.image.max-width: maximum width in characters of banner (default is 72). - banner.image.aspect-ratio: correction to makes sure height is correct to accomodate the fact that fonts are taller than they are wide. (default is 0.5)
Oh my! Thanks for the PR. Have you signed the CLA? |
@wilkinsona yeah. I signed it last week. |
I've tagged this for 1.4 but also labeled "for team discussion" since I'm wonder if we shouldn't consider add such a critical feature to 1.3.x. |
👍 |
This is the last thing stopping our team from adopting Spring Boot everywhere. Any chance of back porting it to 1.2.*? |
@OryxGazella I'm shutting down all my current Spring Boot production apps until this is merged. I'll probably get fired but this is important and I need to stand on principal here. |
@OryxGazella Spring Boot 1.3 has been out for weeks now, WEEKS! What are you still doing on 1.2? |
I'm pretty sure Ratpack has supported this for 5-6 years, why is Spring stuck in the dark ages? |
Can confirm. Ratpack has supported this for 6.5 years. Spring Boot? More like "Enterprise Release Cycle Boot". |
Such an unfair comparison. Ratpack is “asynchronous” & “non blocking” and as a result they can do everything faster. I think we need to consider the bigger picture here and look at how we can work together to create a standard. @craigburke would you be able to draft a specification & create a TCK. I'm happy to donate my avatar to the project and I believe that this would make a fine default banner for all projects. |
I almost forgot, we are going to need a way to also specify banners in XML! |
@philwebb Draft a specification? Create a TCK? XML Banners (what would that look like)? What? Let me know what you need and I can work on it. |
@craigburke I'm imagining some sort of cross between Docbook and WSDL. |
If we're going with XML, we ought to ensure it's as concise as possible. A single pixel banner's only 16 lines:
|
This all seems very reasonable. I'll have it done within the hour. |
@craigburke Some things are more important than steady employment. @philwebb I'll change our CI to deploy a new version of all of our apps as soon as there's a new stable version of any dependency. What could go wrong? After people are used to the idea we could go do this with snapshot versions too. @wilkinsona XML looks good, but you forgot the XML namespace. This is for the enterprise, after all... |
@wilkinsona where is the XSD? This is so disappointing. |
I'm just throwing the banner into |
I would like to actually tweak this a bit so that WHITE (aka light gray) isn't matched quite as often. Ideally I'd want a light green in an image to match to BRIGHT_GREEN even if WHITE is technically a bit closer. |
This is a real cool feature. 👍 |
When can we expect the official spec for this? My enterprise needs this feature ASAP. Is anyone even working on the XML implementation over there? Please get serious about this. |
We are running a system in production which because of reasons can't easily be upgraded to 1.3. |
@craigburke do not forget to setup my "microservices infographic" as the default value |
Where's my recognition? 😉 |
@Shredder121 You can PR. I will gladly merge 😄 ! |
@cbornet I prefer Spring REST Docs over Swagger, will update my version tonight 😊 |
Unless I am mistaken, there is no "try it" button in spring rest docs to generate the banner |
if only we could get the developer of spring rest docs involved... // @wilkinsona |
Oh dear… Spring Boot 1.4 will be released together with JDK 9. All resources bound to banner.xxx by the end of the year ;)
|
I am ok with jokes @michael-simons but let's not push it too hard please :) You intend to write Spring Boot 2.0, right? 😃 |
Hey @jhoeller, it looks like there's a bit if spare resource for some of those 'might not land' features for Spring 5. I'm begging... Please, please, you have to find them something to do before they add a WebGL world full of ASCII art, live updated over a web socket each time someone converts an image on Josh's Boot app |
Hmmmm… WebGL Banner. inside sobering homer image here |
Oh yes... WebGL from animated GIFs http://giphy.com/gifs/loop-the-simpsons-tired-12GbJUnssN6NTa. |
@cbornet Could you maybe side-by-side the original and CIE94 algorithm using that picture? |
Is this going to merge anytime soon? I tried the 1.4.0.BUILD-SNAPSHOT just now and realized that it wasn't in yet. |
@haskovec It's assigned to 1.4.0.M1 so it should be merged some time before that milestone is released. The currently planned date for that release is 24 February. |
Maybe also include a quick text-banner generator:
Example: prints out:
Also perhaps include a way to show the banner at the end of context loading to show up as a signal that the app is ready. |
Add ImageBanner class that generates color ASCII art based on an image file (banner.gif, banner.jpg or banner.png). See gh-4647
Support CIE94 color distance calculations for improved ImageBanner rendering. Based on code originally developed by Michael Simons and added with his permission. See gh-4647
Refactor several aspects of the ImageBanner: - Extract a few new classes and methods from the previous code - Directly encode ANSI rather than using `${}` properties - Rework the scaling algorithm to prefer a fixed width - Allow ImageBanner and TextBanner to be used together - Rename several of the `banner.image` properties - Add support for a left hand margin - Add property meta-data See gh-4647
* image-banner: Add image banner documentation Rework ImageBanner Support Add ImageBanner color distance calculation Support image based banners
This is now merged. Thanks for one of the most important pull requests in the history of the project! |
A source at Thoughtworks tells me that this pull request was instrumental in Boot moving to adopt. Thank you for saving the project from oblivion. |
Add new ImageBanner class that generates ascii art with color based on
an image file (banner.gif, banner.jpg or banner.png). There are
configuration settings that go along with this:
(default is false).
(default is 72).
to accomodate the fact that fonts are taller than they are wide.
(default is 0.5)