Skip to content

aquilax/img2ascii

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

img2ascii

Go Reference | Go Report Card

Image to ascii (and not only) conversion library and command line tool

Usage

func ExampleImage_Encode() {
	ascii.NewImage().Encode(os.Stdout, i)
	// Output:
	// =++++***###%%%%%%%%%######****************######
	// ===+++***###%%%%%%%%%######****************#####
	// -===+++***###%%%%%%%%%######****************####
	// --===+++***###%%%%%%%%%######****************###
	// ---===+++***###%%%%%%%%%######****************##
	// ----===+++***###%%%%%%%%%######****************#
	// -----===+++***###%%%%%%%%%######****************
	// ------===+++***###%%%%%%%%%######***************
	// -------===+++***###%%%%%%%%%######**************
	// ==------===+++***###%%%%%%%%%######*************
	// ===------===+++***###%%%%%%%%%######************
	// ====------===+++***###%%%%%%%%%######***********
	// =====------===+++***###%%%%%%%%%######**********
	// ======------===+++***###%%%%%%%%%######*********
	// =======------===+++***###%%%%@%%%%######********
	// ========------===+++***###%%%@%%%%%######*******
	// =========------===+++***###%%@%%%%%%######******
	// ===#@@===@@*--@#@*%@#+*@%@%#%@%%@@@%%######*****
	// ===@*=====+@--@+=@*+@++@##@##@%%@@%@%%######****
	// ===*%%==#@@@--@--@==@++@**@##@%%@@@@%%@@#####***
	// =====%*=@++@=-@--@-=@=+@*#@**@##@@%%%%%%%#####**
	// ===@@%==#@#@==@--@--@==@%@#**@##%@@@%%%%%%######
	// ===============------==@+++****###%%%%%%%%%#####
	// -===============------=@=++++***###%%%%%%%%%####
	// --=*@@===@=======------====+++***###%%%%%%%%%###
	// ---@==@==@========-------===+++***###%%%%%%%%%##
	// ---@=====@=========-------===+++***###%%%%%%%%%#
	// --@@@=@==@==+@@*====-=%@@--+@@*++@%@%@@@%%%%%%%%
	// ---@--@==@==@*+@=====%*=---@**@++@##@%%@%%%%%%%%
	// :--@--@==@==@@@@=====@=----@==@=+@+*@*#@#%%%%%%%
	// ::-@--@-=@==@*=======%*=---%++@==@++@**@##%%%%%%
	// :::@--@--@==+@@@==@==+%@@--+@@+==@++@**@###%%%%%
	// ::::------===============-------===+++***###%%%%
	// :::::------================------===+++***###%%%
	// ::::::------================------===+++***###%%
	// :::::::------================------===+++***###%
	// ::::::::------================------===+++***###
	// :::::::::------================------===+++***##
	// -:::::::::-------===============------===+++***#
	// --:::::::::------================------===+++***
	// ---:::::::::-------===============------===+++**
	// =---:::::::::-------===============------===+++*
	// ==---:::::::::-------===============------===+++
	// ===----:::::::::------===============------===++
	// +===----:::::::::------===============------===+
	// ++===----:::::::::------===============------===
	// +++====---:::::::::------===============------==
	// *+++====---:::::::::------===============------=
}

Screenshots

ASCII

ascii

ANSI 256 colors Single Height

ansi

ANSI 256 colors Half Height

ansi half

ANSI 24bit color Single Height

24bit

ANSI 24bit color Half Height

24bit Half