This contain code to Convert an Image to Ascii using java, Refer below steps to get started
PNG | JPG
Compile a java file "AsciiImageConverter.java"
Run the class File in CLI (Command Prompt / Terminal) with image name
Example : java AsciiImageConverter java.png
(java.png is the image name of ur expecting image)
Refer : Figure 2
-
Load any image you're interested in (Make sure u are typing correct image name)
If you expecting to Run this code in your preferred IDE, Instead of CLI, skip all other instruction and pass the image name directly in
line no 65
atImageAsciiConverter.java
file
(i,e) at line no : 65 remove fileName[0] and pass argument as your image name ('java.png") instead of fileName[0]
Refer: Figure 3
@ Line 65 => imageConv.convertImageToAscii(
"java.png"
);
Excepted Change To Run via IDE
This code also supports single launch source file, Run this code with single command java AsciiImageConverter.java java.png
in terminal
Refer : JEP330 for more information.
You are expected to have java-11 to perform single launch source file execution in terminal
To-Clone Repo :
https://github.com/dhvakr/Image-To-Ascii_Art
This project is refactored and not actively maintained.. if found any bug in this code!? leave me alone and solve the bugs by yourself😐 refer No Maintenance Intended badge
Distributed under the The Unlicense. See LICENSE for more information.
- Algorithm Tested with jpg and png Image formats only
- Try to run images below 150 * 150 dimension height and width for better viewing
(provided some images for testing this code , Check
SampleImages/
Folder) - Keep executing images in source file directory (i,e) Outside of Sample Image folder
Twitter :
@dhvakr
Feedbacks are precious, please make some time to give your feedback, Thank u☺