# Printing images in the terminal with 9 lines of Ruby

DevFeed: [Printing images in the terminal with 9 lines of Ruby](<https://devfeed.tech/articles/printing-images-in-the-terminal-with-9-lines-of-ruby-40662.md>)

Original publisher: [Read original article](<https://radek.io/posts/catpix/>)

Published: 2015-06-29T00:00:00Z

Content type: tutorial

Language: en

Sources: [Radek Pazdera](<https://devfeed.tech/sources/radek-pazdera.md>)

Topics: [Ruby](<https://devfeed.tech/topics/ruby.md>), [Terminal](<https://devfeed.tech/topics/terminal.md>), [Command-line interface](<https://devfeed.tech/topics/cli.md>), [Image](<https://devfeed.tech/topics/image.md>)

Tags: [code](<https://devfeed.tech/tags/code.md>), [command-line](<https://devfeed.tech/tags/command-line.md>), [images](<https://devfeed.tech/tags/images.md>), [ruby](<https://devfeed.tech/tags/ruby.md>), [terminal](<https://devfeed.tech/tags/terminal.md>)

## AI overview

A Ruby example renders images in a terminal by mapping image pixels to the terminal's extended colour palette. The article then describes catpix, a gem that adds resizing, centering, and custom background colours.

## Source excerpt

Including pictures of cats in your scripts with ease