I want to make a Java application that shows an image in the console, but I cannot find anything on the topic. How would I do this?
-
No. console is for text – OldProgrammer Jan 24 '22 at 16:40
-
What "console"? In linux for example you theoretically could using the framebuffer. But why make your life harder when you can use a GUI? – Federico klez Culloca Jan 24 '22 at 16:41
-
Thank you for the info, I have done Swing graphics, but want to be able to run it on SSH – FrederickAmpsUp Jan 24 '22 at 16:41
-
2SSH is a network protocol – m0skit0 Jan 24 '22 at 16:41
-
@FrederickAmpsUp there's X11 for that, then. But at that point just make the client download the code and run it or serve the picture via http(s). – Federico klez Culloca Jan 24 '22 at 16:43
-
Closest thing is ascii art: https://www.asciiart.eu/ – RobbingDaHood Jan 24 '22 at 17:51
2 Answers
Actually... It sort of is.
You can ouptut shell directives which determine the os to change color of succeeding text. You can also manipulate backgrounds.
It is quite limited though.
Nevertheless one could print a bunch of "pixel" characters and change their color.
Example How to print color in console using System.out.println?
also....this will jot work in an IDE's console.

- 964
- 7
- 16
-
So, is there a program to render an image into colored characters? – FrederickAmpsUp Feb 08 '22 at 23:18
You can show an image in Java console and this is ASCII art.
Of course, this is not a real image as *.png or *.jpeg or whatever but it's still technically an image.
With colored fonts and backgrounds, you can create pretty good art. There is a very nice library on GitHub that could be found - JColor.
You can also look for the ASCII image converter library on Java (or ASCII image generator), the result is quite amazing.

- 205
- 1
- 4
- 13