We generate image to text on terminal
It is made for terminal (CLI) to show image.
When we want to see image on python linux server,
we have to save image or use jupyter notebook.
To overcome those problem, I made this package.
To see thumnail of the image, we can use cv2.imshow in local environment.
However, it is impossible for server ssh terminal.
It is simple thumnail printer using python.
Example
We can print images like down below.
원본 이미지
dotshow
colorshow
How to use
Git cloning on your repository
pip install dotshow
import package on python
Draw image on terminal by putting path
fromdotshowimportloadshowloadshow(<img-path>) # run the code (drawing a color image, default=color)loadshow(<img-path>, color=False) # run the code (drawing a gray image)
Draw image on terminal by OpenCV2 array
importcv2fromdotshowimportdotshow, colorshowimg=cv2.imread(<img-path>)
dotshow(img) # run the code (drawing a gray image)colorshow(img) # run the code (drawing a color image)
Draw image on terminal by PIL Image
importnumpyasnpfromPILimportImagefromdotshowimportdotshow, colorshowimg=np.array(Image.open(<img-path>))
dotshow(img) # run the code (drawing a gray image)colorshow(img) # run the code (drawing a color image)
Parameters
loadshow(
gray = True[default / bool]
size = 7 [default / 0 ~ 10]
)
dotshow(
gray = True[default]
size = 7 [default / 0 ~ 10]
)
colorshow(
size = 7 [default / 0 ~ 10]
)
gray - if your image is not interpretable, give gray parater False
size - if your image is too big in your terminal, reduce size using this parameter
If you use low size parameter, image will undersampled too much and it will decrease image quality.
If you use big size parameter, the terminal cannot describe image because the terminal is too small.
The Tidelift Subscription provides access to a continuously curated stream of human-researched and maintainer-verified data on open source packages and their licenses, releases, vulnerabilities, and development practices.