3 ms·
Here is an image printing function for bash/zsh: function img { for image in "$@"; do convert -thumbnail $(tput cols) "$image" txt:- | awk -F '[)(,]' '!/^#/{
by octoploid 10y ago
Here is an image printing function for bash/zsh:
function img { for image in "$@"; do convert -thumbnail $(tput cols) "$image" txt:- | awk -F '[)(,]' '!/^#/{gsub(/ /,"");printf"\033[48;2;"$8";"$9";"$10"m "}'; echo -e "\e[0;0m"; done ;}
Example: http://i.imgur.com/d5RzWAC.png http://i.imgur.com/d5RzWAC.png
- Symbiote 10y agoI think yours has stretched the image vertically, though it is simpler than the one linked in the article [1]. That uses "Upper Half Block" characters to give square pixels, and sets a foreground and background colour -- doing two rows at once. With that, I see this: http://i.imgur.com/uqCHAmF.png http://i.imgur.com/uqCHAmF.png [1] https://git.gnome.org/browse/vte/tree/perf/img.sh?h=vte-0-36 https://git.gnome.org/browse/vte/tree/perf/img.sh?h=vte-0-36
- cooper12 10y agoJust a note that this requires imagemagick.