Skip to content

ObjectAstra/image2str

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Image to String

Convert image to ANSI string The inspiration comes from here: https://github.com/JonnoFTW/img_term


简体中文README


Installation

pip install image2str

Note

Please use a terminal that can display ANSI strings and TrueColor to run (example: WindowsTerminal)


Functions

image2String(imageSrc, newSize=None)

Tramsform image path / img2str.url class to ANSI string

parameters: 
imageSrc: image path(str) or image url(img2str.url)
newSize: Target image size(auto resize by value None)

return: string after transforming

example:

image2String("readme-images/colortest.png", newSize=(50,50))

will from this colortest-original
to this
colortest-transformed

or this

image2String(url("https://i0.hdslb.com/bfs/article/03245d65e35b7573b6988c26a2a037903ef92896.png"), newSize=None)

colortest-original
to this
colortest-transformed

Mat2String(imageSrc, size=None)

tranform class mat.cv2 to ANSI string (Usage is similar to image2String(imageSrc, newSize=None))

About

Transform image to ansi string

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages