简介

ascii-image-converter 是用 Python 开发的图像转换工具。它能将图像转换为 ascii 艺术照或盲文,支持 JPEG/JPG、PNG、BMP、WEBP、GIF 等格式。

在这里插入图片描述

快速上手

安装

eval "$(curl https://get.x-cmd.com)"        # 安装 x-cmd
x env use ascii-image-converter             # 使用 x-cmd 安装 ascii-image-converter

使用

  1. 将图像转为 ASCII 艺术照或盲文:

    ascii-image-converter <image>           # ASCII 艺术照
    ascii-image-converter <image> -b        # 盲文
    
  2. 启用颜色:

    ascii-image-converter <image> -C                # 启用前景的颜色
    ascii-image-converter <image> -C --color-bg     # 启用背景和前景的颜色
    
  3. 调整输出格式:

    ascii-image-converter <image> -d 40,20              # 调整宽高
    ascii-image-converter <image> --save-img ./         # 将输出内容保存为 PNG 格式并放到当前目录下,生成的文件格式为 <image-name>-ascii-art.png
    ascii-image-converter <image> --save-gif ./         # 将输出内容保存为 GIF 格式
    

功能特点

  1. 支持多种图像文件:支持 JPEG/JPG、PNG、BMP、WEBP、TIFF/TIF、GIF。
  2. 支持盲文模式:支持将图像转为盲文。
  3. 跨平台:适用于主流操作系统,包括 Windows、Linux 和 macOS。

竞品和相关项目

  1. image2ascii:使用 Go 开发的,用于将图像转换为 ASCII 图像的库,并提供有命令行工具。
  2. cfonts:用于在控制台中显示 sexy ANSI 字体的小工具,非常有趣。
  3. image-to-ascii-cli:使用 Node 开发的小工具,用于在终端中以文本格式查看图像。
  4. timg:一个终端图像和视频查看器,使用 C++ 开发。

进一步阅读

  • ascii-image-converter 源代码 - ascii-image-converter 项目的源代码托管在 GitHub,你可以在这里找到最新版本的 ascii-image-converter 和参与社区贡献。

更多内容请查阅 : pkg/ascii-image-converter

转载请标明原文链接 :https://www.x-cmd.com/pkg/ascii-image-converter


关注微信官方公众号 : oh my x

获取开源软件和 x-cmd 最新用法

Logo

GitCode 天启AI是一款由 GitCode 团队打造的智能助手,基于先进的LLM(大语言模型)与多智能体 Agent 技术构建,致力于为用户提供高效、智能、多模态的创作与开发支持。它不仅支持自然语言对话,还具备处理文件、生成 PPT、撰写分析报告、开发 Web 应用等多项能力,真正做到“一句话,让 Al帮你完成复杂任务”。

更多推荐