stefanhaustein / TerminalImageViewer

Small C++ program to display images in a (modern) terminal using RGB ANSI codes and unicode block graphics characters
Other
1.56k stars 111 forks source link

How to speed it up #6

Closed certik closed 8 years ago

certik commented 8 years ago

Thanks for this great app. The images look really awesome. I use Ubuntu 16.04, and a gnome-terminal.

A problem that I noticed is that the program is slow. It takes over a second to render a simple image. As you can see below, I also try to render it to a file (over a second), and then just plot it using cat log. And just catting the file is immediate. So it's not he terminal slowing things down, it's the Java program.

Do you know what the bottleneck is and if there is a way to speed it up?

P.S. When you copy and paste from the terminal, you lose the color, so it's hard to see, but you can see the timings at least.

$ time java TerminalImageViewer -h 100 a.jpg 
⎼▁▇ ▝ ▎▅▇▇▇▆▅━▃▁ ▊╴▇▗┛ ▒▁▂▄▆ ▇━▝▗╴    ▗ ▄╴ ⎽▁▃▒▖╵▊ ▇  ▁▊▘▘▘▎ ╸▁▁─    ▝ ╹▃▒▅▁▃▄▆▄
▘▆▄▎▝▌┗┃ ⎽▅ ╶  ▅─▒▆▆▅ ▅▅▅▅▒▝▃╶▅ ▇▇⎼▁ ⎻╵  ⎻▚▂▂▃▂▃▘ ▎▗⎻▅▎▂▂▄▘╺ ⎼▒━▅    ▝▗━▃▆▗▖ ▝╹╴
 ▃▁ ▊ ╵▆  ▃▅▂┗▒▖ ▆▇▅▌▁ ▃▄▂▃▅  ╴▄▄▘  ▊━▊ ┛┛┛▎⎻⎺╵▒⎺╶╴┓▅▅▆▄━▅ ╺▄▃╵╵ ┓   ▌▅▁▌ ▁╵▎▁▁⎽
┛▗▅ ▊▘╹╺ ╴┛╶   ▁▚▎▇▁▂▆▝ ▄▄▃ ▂▁▄▅▃ ⎽⎼⎼▃▖ ▁▒▇  ▇┗▗╴╴▒─▅▃▒▆▖╵▒╵▒▃▒┗┓▗ ▊▘ ▆ ┻━▆▅▒▁▆▘
⎼▇▒▎▎  ▁▊ ▃ ╵▆⎻▝▌▅▊▂▌┗▄▄▂▂▅▇▂▚╴▊⎽╺ ╴ ▝⎻▄━▆▅▒▁━▂▅╵▂▂⎽▂▝▌▒▒   ▃▒╵▆╴▌▁▘╴╴  ┃▗▖  ▇─╴
 ╵⎼ ▁ ▎╵ ▁    ╵▊▚━▊▗▘━─▄ ▊▘⎺▂▁ ▊⎽│▂⎼⎼▌▖▗▄▒▂╹▃▊▅▆ ▎▇▅╏    ▒ ▎▘▄▄⎺▆▂╴╺╵▂▒╶╴▆ ⎺╶▁⎽╺
╹ ▇▘  ▒┓╶╴  ┏▃▆ ▒ ╺▅▒▅╶▁╹─╴▄    ▃▅▇⎼⎼│ ▝─━╴▝┗▆┗⎻ ━╴▊▒▇╸ ▁▃  ▁╵▘▊▁▊╴▗▂▃▖⎼▊▆⎼▃▂▂  
╴▁▄▘⎻▇▂▚▃ ▆│ ▃━▎ ╵▆▅▆  ╺│ ▒ ╴╴ ╺   ▗ ╵▘▝▁▒▅▖▁╋   ▄▝⎼▁ ╴     ▆▆▅▆▒▁▊▄▅▘ ⎺⎺╺▅▁▇▄▄▄
▒ ▃▝ ▝▇▊╸  ╵  ╴▘▅  ─▝  ▁▊⎼    ▎╸▘╺▁▝ ▝▌▝▂▒▁▚╸▃▘▝▊▘▄░▖╸▆╺    ╺⎽╏▂╵▝ ╺ ▃ ▁⎽  ▆▖▌ ▗
▝▅▃┛▃╺⎻▊▎─▄┗   ▌▁▂ ▁ ▁▇▇▝⎻ ▆ ▊━╴  ╴▆▅▃▊▂▃▚▘▇⎽▊┛▘ ╏▒▂▁⎼ ▂   ╴╴▆╴ ▆ ▅▅╸▇ ▂▃▘▁▄┻▄▂▆
╴▖╴▃ ▊ ┃▘▘ ┃▂ │  ▁▅▌⎺ ▊╸▊  ▇ ╸╵  ▆⎻⎺▒╴ ┗ ▒⎻▄▅ ▒▎  ▒  ▄⎻─▘⎺▆╵╶ ⎽ ⎽ ▄▆▁▃▄▆▇┗▘▗▃▌╴▁
┗  ▄ ▒╵▒▌│▇│━  ▅┗▘▆ ▆▅▆▝▖    ╴▊ ░▁▂▘▂▒━ ▒▝ ▌▅▅▎  ▎▂▒╴╶⎼╵▎ ╴ ─ ▘ ╹  ╸▅▃⎼▃▄▄▗▚  ▅▝
╵▄ ╺  ╸╴▊    ╏ ││▌▖▖ ─▁    ▁▃⎼╺▒─▅▄▆▊│ ╸▃╴╺ ▃▒ ▂╴▅⎺▚╴ ━⎻  ▂╵╴ ╵ ━▎  ╺╴▆▅▄▘┃▅   ╺
╸╴─  ─▒┏▒┛ ▌▖▂ ▘▌▃▂▁▁▗▅▗╴╸╸ ╺▁│ ▄ ▎▝▇▒⎻▄▚▒ ▁╶┓▗ ▗▂╵    ▗ ▗─⎼ ▆╴─▒▗▖ ▁▁▆▇ ▗ ┫▒━╹⎽
┫▒▎▁  ╴▘▖┃╵▃▇▘▝▆ ▄▎▄▝▆▎▆┃▎╏ ▁▁│╵ ▃▖─▎╵ ▒━⎽▂▁ ⎺▌╵─▇▚╵╴╵ ╸╵  ╺ ─⎺▇▒ ╵ ▇┏▅⎻━▂▆┓ ▂━━
▇ ╏╺ ▆⎽▊▇╺▄ ▅ ▗▂▊  ▅▄▊▌▅▁▖▊▃━▄┗│▁  ▚⎺▎╴▒    ╴╴╺▒▒ ▊▁━│▒▎ ╵╴  ╵▁╴    ⎺⎼   ▆▃━ ▝▊ 
  ▅┏ ▊  ▒▘▗▆▝▝▆▖▖ ▊▄▂▌  ▝▄▊▂━─▎ ╶╹╶▄╏┗▆ ▇▅⎽▇⎻━━─╺▒▊▊▅▎  ▊▒▁ ╴ ╴⎺ ▄ ▒▇▁▁▂┗⎽▘ ▌┏─▒
▌╸▇▆ ▊━   ▘▗╸▝▌▗▃▘ ▗▅   ▅▁▖▌ ▁▌ ╏▎╹  ▂▖━▝▖╴╴▝│ ▒┗▚┏▌⎼▅▁▊▒▒╏▒⎺╵   ▂▊▅▆▇ ▂ ▎━ ▂▃╴⎼
▎▁┏━  ▚┣▊┛▃┓▌▅▄▌▆ ▅ ▅▃▃▄▗▖  ▆▅▖ ▊│▘   ▝▂ ▊    ▆ ▌▌│▎▖▗▇╵▆┃▊▊  ╶▃ ⎽    ▇▒⎻╵╹ ▘│▌ 
⎽▄▅▖  ╏▌   ▊╺▃ ▘▃▊ ▝ ▄╶ ▖ ▚ ▊▆▆ ▘ ▇▗  ▊▆▝▒▃⎼╴▆▗ ▒ │▎▂▗┏▎╴▒░╸ ─ ╵ ▚╴▁  ⎽▌▎⎻ ▁▖▅▎▇
╺▒▒┃╸╵▃▂▂▎┏▘▁▂ ▖▁ ▝▃▁▗▖▅ ▂ ┓ ▄▆ ▘▃ ▗▅▎▊⎺╹▂ ▘ ▌▖▁╏▘─▒│▗▁╴  ▝▄▊▌▎ ━ ▗▂⎺╴▁▅─▗▗▆─   
▁▘▂▊▎ ▎▊▇▎▂▖▝▆ ▎ ▂⎼▆▎▊▌━ ▄┗▊▚▖▖▗▗▂│▊╸▎▊▇▅┗▃▁▗▄▎▌│╺┃━▘┏▇─⎺▆▁▗▊┃▎ ▊ ▅▖▎▅╹▒▃ ┗  ▊╸ 
╴▝▆▊▎ ▎▆ ▄▅ ▇▆ ▌▇▌ ▁▊ ▊▆▌▝─ ▚ ▌ ▎┃│▊▂ ▊  ▎▄▌▎▄▎ ╸▝▃▘▒▎ ▖▒╴▝▘▊▆▎▒▒▂▖▎▁▒▄▄▒▖╶▊ ▄ ▂
  ▊   ▎╺▎┗▎╵▃▂   ▁▂▁▊▊ ▒▆▌▊╺ ▌▊▊▚▗▌▊┻ ▊▎▝╴─▌╴▒▎▊  ┫▎▅▗┛▒   ▅▊▊ │  ▂▌ │ ▄▄━  ▁⎼ ╵
 ▊▂╵▗ ▎▁▖▆▃  ▗▁  ▄▂▃▌  ▎▌▊▄╴▊┃▌▌▊┃▊╵▁▁▊╹▂━▆▅ ▒▁▂▃╏▊▊▎┗▘▗▝▃▂▖ ▖╹ ▊▗┏▎━│▃▁▒▅▂▌ ╸╴▎
 ┓▂▗┛▃▃╴▆▂┏ ▄▄▂▁▆▅▂▃▎ ▒▎▃▌ ▗▎┃ ▂▂▖  ▇▖▇│╹▝▆▄▄ ▃▂▂▃▄▄▃▂▁▁▆▌▃▂▁▝▂▁▌▂▝▝▗▅▗▆▖─▆▘▌  ╵
▄▝▘╵▃ ▌▝▊▂▅▆▌▁▆▅▄▆▃▄▂▂▂▎▁▁▁▁▁ ▎⎽╹▊ ▌ ▘ ╸   ╵▆╵▗ ⎺ ▊│▆▒╵▁╹     ▘  ▄▘▊ ▇┏ ┏▃▁▁▘   
▅▄▆▆▆▅▆▆▇▇▝▊ ▄▆▄▃▁▅▂━▅┃▎▇━━▂╺▊▌▆▝  ┛▆▇▆▇    ╵  ▗ ▆▅ ▅▖⎽━▖╴ ╹╵   ╴╴  ╵╵  ╵▂▃┗━▆▂▄
▃ ▄▆▆▂▃▅▝▇▝▊┓▎▖╵▁▎ ▆▅▄╹▎▃▃▃▃▗▄▅▁▅   ▆╴  ╴╵    ▗ ▖    ▇▇▇▇▄ ▃  ▆⎺─│▘⎺   ▇ ⎻╵▆▆▅▄▝
▁⎼▄▄▅━▃┻▃▄╶▃▖▖▌▖ ┓ ▁╴⎺▌▌▃▃▃▊▊▁▁▁▁▂▃▃▄ ▄⎺ ╹▆╵▄  ⎻ ▚ ⎼─▃▄▅▄▆▆ ─ ─ ▄▃▂▂▁▂▅▄ ─ ▂▂   
▅▅▆▄▂━━━▄▄▄▄▝ ▌▅╵╴▊  ▒╺│▖▆╺ ▊▃▁▂▃⎻▂▅▅ ▅▂▁▃▂▂▃▃▆▃▃ ▚ ▂▁▁▂▁▁▁ ▆━▅━▆▒──⎼▇▊▄▃▃▆   ▄▃
━⎽⎽▂ ▅▃╺▄⎼─╵━   ┃▌  ⎼╸▝▘▒┓╵▃ ▆▄▃▂▆▄▇▇▇▄▅▄▅▘━▁▇▆▆┳▆ ▚ ▇▅▅▅⎺▃▃▃▃▂▃▁ ▄▆▆▆▅▅▅▅▅▇▆▅▄▅
⎻▁▁▂▂▃▄▃▄▄▃▅▅▎▌▗ ▌⎼ ▄▅▊╹▗▌▎▖▅▅▃▆▂▅▅▅▅▃▂▆▅▅▅▂▄▂▃▆▂┗▂ ▚ ▃▄▄▅▄▅▂▇▗▇▅ ▇▇▇▄ ▁▆▅━▇┻┳━▂
▘▂▂▂▇▅━▂▅▅▆▁⎽▌┓▖▗ ▒ ▇▆▊╵▂▗▝▘▊▄▁▂▃▄▂▆▂▄▂▅▂▗▖▂▆▆▃ ▒▖╴▅ ▝  ▂▁▃▆▂    ▖ ▆▅▁▊ ━▄▃▃▃━╸▅
▄▄▄▅▃▅▃─▇▁⎺ ▒▌▌  ▖▒▃╏▊ ▊▎┗▝▖▌ ▇ ▃▃ ▅▄▄▃▃▃▃▂▂▃▆▁⎽▆▄╵▅ ▝▝ ▗▇▁▁▁▊▃ ▁━ ▁▂▂ ▎▆⎼▂▂▃ ▁─
▗━▅ ▄▁▅▅▁▗⎼▁╵  ▗ ▎   ▎▘▊▎▊▂┓  ▗▁▆▁ ⎺▝⎼▚┓─╵⎼▄ ▘━▂╴─ ╺─ ▝▝ ▅▝▃▃▊ ▅ ▂▇▎╶╴▎▎▁▃╵ ▆▁▒▗
╶⎽▂▂⎽━▌⎺▃▆╵⎼┗▅▎│╵▎▁│ ▊┓  ▎▎▊▊▎▂▅│╴ ▆▒▆╺⎺ ▇▒▊▊ ╴▄─⎼▁▅▃▃▃▝▌▂┛▄▁▘▗ ▊ ▁▂▁ ▊ ⎻┓▁ ▃ ┗┓
▄▄▃▄▄━▄▄▂▊╴⎽▁▊ ▌⎻─  ╸ ▊▌▎ ▗┛ ▎▚ ╸ ▒▓┃▒▒╹  ▁▄ ▃▇▆▇▇╺╸ ╵━▅▝┓ ▅  ▊▘ ▃▂▂▃▝▁▂▄▃╹▒╹ ━▗
▆▅▅▄▅▆▆▄▁┛▅▝▁▃▎┃╵▒▂   ▌╵ ▁▊ ▗  ▒━▅▘│ ▄╴▃▒ ╵⎺ ─▒▅ ▁  ⎺▇⎽│▂▌ ▘ ▊▊▅  ╸▆⎽   ▘━▅━▅┳▎ 
▁▇⎻▝⎻▃▂▝▅ ▁▎▝▗  │⎽⎽▌▊▊▌╵╵▖▁▗ ▂┛▃▒▂▒▒╏⎺▁▘╏ ▅▖▊ ▇▒▁╏╴▗ ╵▊⎺  ▇▎┛┗ ▎╹    ▚▊ ⎼▃▃▁▄▁┳▅
━▎▄▖▅▄▃▆▅▇▆▆▄▎▘▎▇▅▃▂▎▗▘▌╵▗ ▊▃▂▂▁▁╴▝▆⎺▁─⎻╹▆▂▅▘╺▚▂ ▊▅ ▄▄▂ ▘╸▗ ▎▗  ━▃▅  ▊▊ ▖▆▒▂╴▗╴▒
▂▂▁▒▎ ▗▄▄▂▃▂▁▎⎺ ▊▄ ▄▂▄▗╵▌▄▁▝ ▁▁▃▃▅▅▇▆▆▅▄▃▃▃▅▅▁▆▆▃▆━▄▃▃ ▘ ▃ ▚▘▗▅▄▄▃▄▃▝  ▖▊▂▁▖▁  ▆
▅▌▃▇▆▄━ ▂▄▄▄▊▖▗▘▃▁▁▄▊▌▄╵│▌▂╵▎▝▂▗▄▃▄▅▄⎺▂▊▅▖━▅┗▅╸─▁▄▌▌▖  ▆▌▁ ▝▂┏▘╸▖ ▆▃▇  ▘▊▒▎ ╴╴▂╵
▇▂━▗▃▄ ▘╺▆▆▆▌▝▘▊▃▃▄━⎻  ▊ ▆▅▌▅▅▄▄▃▆▃▄▖▃▂▅▅▆▅▄▄▂▆▄▖━▃▌▖▌▊▎⎻━▁ ▘▎▎▄ ┓▁▊ ▗  ▂▒▂⎼▂╴▊▆
⎻▃▘▁⎺⎺▆▅▅▃▅▃▎╺▆⎻▄  ▆▊ ▆▊   ▃  ▅▆▃▆▆▌▄▅▖▌▂▃▃▆▊▊┗▊ ▆▃▊▄▗▅▃ ▖▌▊▆▅▊⎼▊╸ ▖  ▊ ▖▝▃▅▆▆╴ 
 ▆▒▆▆▇▃▌▊▌▌╵▌▎▖ ▅▆▆▃▌▝▃▂ ▅ ▁▌ ▆▅▆▃▂▁▂▁▂▃▁▆▅▄▘▅╸⎺┗▇▝▄▄ ▘▁▊▊▆▌▄ ▆▃ ▄▖▄▌ ▂▁▘┓▃▅▄▄▁▗
⎻ ▁▂ ▖ ▚⎻▆▗▃▌    ▁⎼▗ ▆▆▄▎▅▄▃─╺━  ▆▇▅▄▄▃▄▃▄▄▃━▅▅─▄▃▒▆▊ ▁▗   ▌ ▌▄▄▖▊▗▅ ▎▌▃▅▆▆▖▂▅▆▄
▂▆▆ ▆▆⎽▃▁▂▂▁▊ ▌⎽    ▖▁▁▗▎ ▘▌ ▆▅▝▎▊▎▚▅┛╶▝▄▆▄▆▅⎼▗ ▂ ▁▁ ▃▄ ▝▄▌▝▌▖▌▚  ▝ ▝▅▊▅▄╹▃▌▅▌ ▅
▌▖▅▅▎▝  ▄▃▅▄     ╴▁▂▘ ▌┗▎▎▂▌▖╴╺⎽ ▅▆▌ ▁▁▁▗╴▘▚▆▆ ━╺ ▃▃ ▆━▗ ▄ ▒▝▖▝ ▆▝ ▎▅▄▄▂▚▖▃▃▄━▎▗
▆▖─▖▝▌▝▄▄▃⎻ ▇▝▂▂▃▘▂ ▁▄▂ ▎▎▆▂▌▝▚▂ ▄ ▅▄▄╺ ▃▂ ▊▗▆▂▃▆▁▝▄▂ ▆⎺ ━ ▖▊▊  ▝▃▘▝▃▄╸▘▌▎▁┏▌▂▎ 
▁┓▚▅▄━▗▒▁▄▇▅▂▆▝▆▆▇   ▆━╸▌▎▄▌▎▇▆┏ ▂▘▁▂ ▒▁▅│▝▆▖▝▂┏▄▁▂▄▄▒▂▆▆  ▄▃ ▅▂▅ ▆▄▇▘▎▂▂▂▅▆▄▄▂▄
▃▄▅╸▘╺▅▅▇▆▅▂▒▁▃ ▇▁▆▅▚▌┓▗▌▌▄▁▘┏▘▇ ▘▒▅▊▒▆▄▅▅▄━▖┗▘ ▘▅╵▝┗▅▂▆▄▌▇▅▂┻▄▃▃▃▄▅▖▄▁▆▅▆╵▂▆▂▁▂
▅▇▆▅⎻▗▂▃▇▊┛▊▌▇▅▄▃▝▁▖▅ ▊▆▌▌▎▅╺━▖▃▅▂▘▘▝▃╴▂▎▘▊▊┃▂┻╸╶━⎽▁▁▂▂▁▁ ▂▂▃▖ ▃▂ ▊╵ ▄▆▊▘▁▊⎼▌▃▆▝
┓▁▁▄ ▃⎺▆▒▅▄▃▃▁━▅ ─▅▄▃▅▆▂▊▌▁▁⎽━▃▃▆▆▌ ▃━▁┗▂▘╹▊▁▇▎▂▅┃▇▆▆▄▌ ━▂▘   ▎▖▎▃▘▁▁ ▃ ▄▂▃▂▊▘⎼│
▂⎻▅▂▁▁▆▆▁ ▂╹▗▚⎺━▂▁▂▂▃ ▅┗▊▌▃▅▁▌▅ ▃▗▅┗▆▂▗━▅┗▄▝▅  ▗▂╸▂▁▂▊ ╸▁▅▝▊▌ ▅╺▃▄▗▆ ▗╏╵▖▃▃▃▌▄▗▚
▘▒▂▄▒╸▃▅▂╏▘━▃▄▆▅▅▆▅▄▂▄▃─ ▊▎╺▇▅▇▝ ┏━⎼╴▆▂▌▌▅▖▊▌▆▝▄▆▁ ╴▗╺▁▅▁▖▁▝▇▅▃▂▄▂⎼   ▌ ▆▊▃▅▄╸▗━
 ▝▝▃╴▇▗▂▃▄ ▄▊ ▃▄▄▄▄▄▄▄▄╴▅╵▎▃╹▁ ▃▘▅▅▆▌▄▗▂╵▘▝▅▚▄ ▃▄╸╶▃▂▃▘━▄▅▖▆▇▇▂▆▆▇▆ ▄▘▃▃▃▁▅▌▌▎▅▊
▂▂╵▄▘▆▅▇▇▅▆▊▂▃▃▖▌▌│▅▖ ▃ ▂▗▎▖▝▂▌▂▃▅⎻▝▅▆ ▆┏▂▃┓▘▒▌▂▄▄▁▅▅▅▁▆▊▁▌ ▆┏▌▊▅▄▅▄▅▅▇ ▆▃▎▝▄▘▘ 
▗▆▆▆ ▎▌▄▘▇┓╵▄▃┓▌▁▝▝ ▃▁▂  ▅  ▇ ━▄▘▂▂▃▄▄▄▄▅▃▆┃▖▌▌▊▁▂▃▄━─▖ ▄╴▖▗▆▂╹▄▄▃▁ ╴▝▅▅▆▂▅▁▄▅╵▃
▂▁ ─▝ ┻▅▊▇▅ ┛ ▁▁▂▁▁▁▃▃▝▁▂▆▒▅▖▄▅▄▘▃▘╺▁⎽▖▄▄▗⎻▅▇▒┃▃▄▄▄▘▄─▝▄▁▆▃▇▄▂▂▁╴╹▅▆▁▂▂▃▅▇▇▂▃▄▅━
▂▅▆▄▅─▅▄▃▄╴▅▄▅▆▇▄▂▆▄▄▅━━▂▂─▁▁▂━▆▊▆▃▊⎼▗▘▇▝▌▚▌▃▂▘▁▚▆┓━▄▅▆▅▅▘▘▗▁ ▒▅▂▃▄▆━▃▄▆━▂▂▅▅▇▂▂
▅╸╵▂▎▝▅▖──▒━▗▃▘▝▁▝▊▁▂▁▚▄▄▝╺━▄▌▁ ▊▌▅▁▆▆▅▄▃▂▄─▊━▂▗▃ ▁ ┃▝▂▂▁▂▁▌▃╋▂ ▗▄▂▄▄┏▁▄▂▂▃▃▅▅┃▄
┛▅▂▆▅▖▃╸▝▆▅▅▅▆ ▒╶▄▆▌▅▆▘▌▗▄▄▄▂▁▝▃▂┓╺ ▄▃▅▅┛▃▒▃▒▄▂▊▂▅▄▌▅▂▄▆▂▃▘▁▌▎⎻▅▁▆▄▆▃▅▎▆▂▃━╴ ▌▂╵
▎ ▅▃▃▂▂▃▃ ╹▂▃▌▗▃▒▇  ▎▗▄▌▝▂▎▁▘▂┓─▄▂▂▄▄▄▅▄━▎▄▆▃━╹▎▌▅▅┏▝▄▆▃▁▅─▂▆▆▄▅▅▅━▎▄▆▗▎▄▃▆▂▄⎼┗▃
╵╹▝▁▘⎼╏ ▂▂╴ ▝ ▝▄▅▃▎╴▆▃┗⎼▂▅▅╴▌│▘▗▁▝ ▎▅▄▅▊▒▂▒▂⎽▆▇▚▒▊ ▃▃▂▁▃▖▖▗▅▖┛▄▅ ▘┓▄▄▂▄▘▁▄╵▊▃▎┗⎼
▄▂▂▃▂▃▎▝▂▄▃╵▇ ▂▊▄▁▌▂▂▂▄▌▖▂ ▄▎▊▂▅─▆▄▂▄▃▆▚▁▃⎺▄▆▂▚╶▄▊▅▂▄▃▆▄▖▘▗▇▁▌▊▘▆▁▂▁▊ ▗▆╴▂▗▂╵▄▇▌
⎽▄▅▆▖━▃━▒▂▅┳╴▁━▂▂▂▆ ┻▄▁▊╺━⎼▂ ▃▚▂ ▊ ▄▄▆▆▄  ╴▁ ▊▂▂▗▅▂⎼▃▂▅▄▗▄▂▆▌▆▊▄▎╴▆▅▆╴ ▒┛▂▆⎻▂▌▌▝
▂▁▁▝▆▁ ▅▆━▃▆▇⎻▄▄▆▇┓│━▂▆ ▅▁│▖▂▎▌╏▌▝ ▄▃▆━▄▘▃▃▄▖▌▝▘▂▌▗▗▄▁▁ ▌▃▁▌ ┃▃▄▗▃▊▂▝ ▁ │▅┏▂╴▅▂▊
▎▆▅▄▌▃▃▂▎▄┏▄▆▁▗▂▖▂▁▅▒▊▃▃▃▄▃▂▃▂▁ ╸▎▇▁▅▃▂▁━▘╵━▒▊▎▌▆▃▄▇▇▇▗▂ ▆┏ ▎▂▄▁ ▃▝▎▎▃▆▅╏▇▂▂┏▄▄▂
▂▅▊▃▌▃╵▂▂▄▄▆▇▄▃▄▇▄▄▄▂▌╺▅▃▂▌▝▘▗▂▇▅▂▃▄━▂▌▝━▎▂╏▂▘▗ ▊▊⎽ ▗▂▒╸╵▃▅▁▂▄▖▎▊▗▄▒▎▌ ▄╏▂▎▃▘▌ ▃
▃▂▆▆▇▌▘ ▇▎▊▗▄┓▂▂▁▝▘▌▘ ▁▌▂╸▆▂▊▂┓▃▃▖▊▆▆▃▚▃▒▁▂▃▎ ▎▂▊▄▅▌▌▝▂▅▆▖ ▝▒▃▅╸▌▁▁━▂▄▅━━▅▘▁▁▝▄▂

real    0m0.796s
user    0m1.324s
sys 0m0.060s
$ time java TerminalImageViewer -h 100 a.jpg > log

real    0m0.773s
user    0m1.248s
sys 0m0.036s
$ time cat log
⎼▁▇ ▝ ▎▅▇▇▇▆▅━▃▁ ▊╴▇▗┛ ▒▁▂▄▆ ▇━▝▗╴    ▗ ▄╴ ⎽▁▃▒▖╵▊ ▇  ▁▊▘▘▘▎ ╸▁▁─    ▝ ╹▃▒▅▁▃▄▆▄
▘▆▄▎▝▌┗┃ ⎽▅ ╶  ▅─▒▆▆▅ ▅▅▅▅▒▝▃╶▅ ▇▇⎼▁ ⎻╵  ⎻▚▂▂▃▂▃▘ ▎▗⎻▅▎▂▂▄▘╺ ⎼▒━▅    ▝▗━▃▆▗▖ ▝╹╴
 ▃▁ ▊ ╵▆  ▃▅▂┗▒▖ ▆▇▅▌▁ ▃▄▂▃▅  ╴▄▄▘  ▊━▊ ┛┛┛▎⎻⎺╵▒⎺╶╴┓▅▅▆▄━▅ ╺▄▃╵╵ ┓   ▌▅▁▌ ▁╵▎▁▁⎽
┛▗▅ ▊▘╹╺ ╴┛╶   ▁▚▎▇▁▂▆▝ ▄▄▃ ▂▁▄▅▃ ⎽⎼⎼▃▖ ▁▒▇  ▇┗▗╴╴▒─▅▃▒▆▖╵▒╵▒▃▒┗┓▗ ▊▘ ▆ ┻━▆▅▒▁▆▘
⎼▇▒▎▎  ▁▊ ▃ ╵▆⎻▝▌▅▊▂▌┗▄▄▂▂▅▇▂▚╴▊⎽╺ ╴ ▝⎻▄━▆▅▒▁━▂▅╵▂▂⎽▂▝▌▒▒   ▃▒╵▆╴▌▁▘╴╴  ┃▗▖  ▇─╴
 ╵⎼ ▁ ▎╵ ▁    ╵▊▚━▊▗▘━─▄ ▊▘⎺▂▁ ▊⎽│▂⎼⎼▌▖▗▄▒▂╹▃▊▅▆ ▎▇▅╏    ▒ ▎▘▄▄⎺▆▂╴╺╵▂▒╶╴▆ ⎺╶▁⎽╺
╹ ▇▘  ▒┓╶╴  ┏▃▆ ▒ ╺▅▒▅╶▁╹─╴▄    ▃▅▇⎼⎼│ ▝─━╴▝┗▆┗⎻ ━╴▊▒▇╸ ▁▃  ▁╵▘▊▁▊╴▗▂▃▖⎼▊▆⎼▃▂▂  
╴▁▄▘⎻▇▂▚▃ ▆│ ▃━▎ ╵▆▅▆  ╺│ ▒ ╴╴ ╺   ▗ ╵▘▝▁▒▅▖▁╋   ▄▝⎼▁ ╴     ▆▆▅▆▒▁▊▄▅▘ ⎺⎺╺▅▁▇▄▄▄
▒ ▃▝ ▝▇▊╸  ╵  ╴▘▅  ─▝  ▁▊⎼    ▎╸▘╺▁▝ ▝▌▝▂▒▁▚╸▃▘▝▊▘▄░▖╸▆╺    ╺⎽╏▂╵▝ ╺ ▃ ▁⎽  ▆▖▌ ▗
▝▅▃┛▃╺⎻▊▎─▄┗   ▌▁▂ ▁ ▁▇▇▝⎻ ▆ ▊━╴  ╴▆▅▃▊▂▃▚▘▇⎽▊┛▘ ╏▒▂▁⎼ ▂   ╴╴▆╴ ▆ ▅▅╸▇ ▂▃▘▁▄┻▄▂▆
╴▖╴▃ ▊ ┃▘▘ ┃▂ │  ▁▅▌⎺ ▊╸▊  ▇ ╸╵  ▆⎻⎺▒╴ ┗ ▒⎻▄▅ ▒▎  ▒  ▄⎻─▘⎺▆╵╶ ⎽ ⎽ ▄▆▁▃▄▆▇┗▘▗▃▌╴▁
┗  ▄ ▒╵▒▌│▇│━  ▅┗▘▆ ▆▅▆▝▖    ╴▊ ░▁▂▘▂▒━ ▒▝ ▌▅▅▎  ▎▂▒╴╶⎼╵▎ ╴ ─ ▘ ╹  ╸▅▃⎼▃▄▄▗▚  ▅▝
╵▄ ╺  ╸╴▊    ╏ ││▌▖▖ ─▁    ▁▃⎼╺▒─▅▄▆▊│ ╸▃╴╺ ▃▒ ▂╴▅⎺▚╴ ━⎻  ▂╵╴ ╵ ━▎  ╺╴▆▅▄▘┃▅   ╺
╸╴─  ─▒┏▒┛ ▌▖▂ ▘▌▃▂▁▁▗▅▗╴╸╸ ╺▁│ ▄ ▎▝▇▒⎻▄▚▒ ▁╶┓▗ ▗▂╵    ▗ ▗─⎼ ▆╴─▒▗▖ ▁▁▆▇ ▗ ┫▒━╹⎽
┫▒▎▁  ╴▘▖┃╵▃▇▘▝▆ ▄▎▄▝▆▎▆┃▎╏ ▁▁│╵ ▃▖─▎╵ ▒━⎽▂▁ ⎺▌╵─▇▚╵╴╵ ╸╵  ╺ ─⎺▇▒ ╵ ▇┏▅⎻━▂▆┓ ▂━━
▇ ╏╺ ▆⎽▊▇╺▄ ▅ ▗▂▊  ▅▄▊▌▅▁▖▊▃━▄┗│▁  ▚⎺▎╴▒    ╴╴╺▒▒ ▊▁━│▒▎ ╵╴  ╵▁╴    ⎺⎼   ▆▃━ ▝▊ 
  ▅┏ ▊  ▒▘▗▆▝▝▆▖▖ ▊▄▂▌  ▝▄▊▂━─▎ ╶╹╶▄╏┗▆ ▇▅⎽▇⎻━━─╺▒▊▊▅▎  ▊▒▁ ╴ ╴⎺ ▄ ▒▇▁▁▂┗⎽▘ ▌┏─▒
▌╸▇▆ ▊━   ▘▗╸▝▌▗▃▘ ▗▅   ▅▁▖▌ ▁▌ ╏▎╹  ▂▖━▝▖╴╴▝│ ▒┗▚┏▌⎼▅▁▊▒▒╏▒⎺╵   ▂▊▅▆▇ ▂ ▎━ ▂▃╴⎼
▎▁┏━  ▚┣▊┛▃┓▌▅▄▌▆ ▅ ▅▃▃▄▗▖  ▆▅▖ ▊│▘   ▝▂ ▊    ▆ ▌▌│▎▖▗▇╵▆┃▊▊  ╶▃ ⎽    ▇▒⎻╵╹ ▘│▌ 
⎽▄▅▖  ╏▌   ▊╺▃ ▘▃▊ ▝ ▄╶ ▖ ▚ ▊▆▆ ▘ ▇▗  ▊▆▝▒▃⎼╴▆▗ ▒ │▎▂▗┏▎╴▒░╸ ─ ╵ ▚╴▁  ⎽▌▎⎻ ▁▖▅▎▇
╺▒▒┃╸╵▃▂▂▎┏▘▁▂ ▖▁ ▝▃▁▗▖▅ ▂ ┓ ▄▆ ▘▃ ▗▅▎▊⎺╹▂ ▘ ▌▖▁╏▘─▒│▗▁╴  ▝▄▊▌▎ ━ ▗▂⎺╴▁▅─▗▗▆─   
▁▘▂▊▎ ▎▊▇▎▂▖▝▆ ▎ ▂⎼▆▎▊▌━ ▄┗▊▚▖▖▗▗▂│▊╸▎▊▇▅┗▃▁▗▄▎▌│╺┃━▘┏▇─⎺▆▁▗▊┃▎ ▊ ▅▖▎▅╹▒▃ ┗  ▊╸ 
╴▝▆▊▎ ▎▆ ▄▅ ▇▆ ▌▇▌ ▁▊ ▊▆▌▝─ ▚ ▌ ▎┃│▊▂ ▊  ▎▄▌▎▄▎ ╸▝▃▘▒▎ ▖▒╴▝▘▊▆▎▒▒▂▖▎▁▒▄▄▒▖╶▊ ▄ ▂
  ▊   ▎╺▎┗▎╵▃▂   ▁▂▁▊▊ ▒▆▌▊╺ ▌▊▊▚▗▌▊┻ ▊▎▝╴─▌╴▒▎▊  ┫▎▅▗┛▒   ▅▊▊ │  ▂▌ │ ▄▄━  ▁⎼ ╵
 ▊▂╵▗ ▎▁▖▆▃  ▗▁  ▄▂▃▌  ▎▌▊▄╴▊┃▌▌▊┃▊╵▁▁▊╹▂━▆▅ ▒▁▂▃╏▊▊▎┗▘▗▝▃▂▖ ▖╹ ▊▗┏▎━│▃▁▒▅▂▌ ╸╴▎
 ┓▂▗┛▃▃╴▆▂┏ ▄▄▂▁▆▅▂▃▎ ▒▎▃▌ ▗▎┃ ▂▂▖  ▇▖▇│╹▝▆▄▄ ▃▂▂▃▄▄▃▂▁▁▆▌▃▂▁▝▂▁▌▂▝▝▗▅▗▆▖─▆▘▌  ╵
▄▝▘╵▃ ▌▝▊▂▅▆▌▁▆▅▄▆▃▄▂▂▂▎▁▁▁▁▁ ▎⎽╹▊ ▌ ▘ ╸   ╵▆╵▗ ⎺ ▊│▆▒╵▁╹     ▘  ▄▘▊ ▇┏ ┏▃▁▁▘   
▅▄▆▆▆▅▆▆▇▇▝▊ ▄▆▄▃▁▅▂━▅┃▎▇━━▂╺▊▌▆▝  ┛▆▇▆▇    ╵  ▗ ▆▅ ▅▖⎽━▖╴ ╹╵   ╴╴  ╵╵  ╵▂▃┗━▆▂▄
▃ ▄▆▆▂▃▅▝▇▝▊┓▎▖╵▁▎ ▆▅▄╹▎▃▃▃▃▗▄▅▁▅   ▆╴  ╴╵    ▗ ▖    ▇▇▇▇▄ ▃  ▆⎺─│▘⎺   ▇ ⎻╵▆▆▅▄▝
▁⎼▄▄▅━▃┻▃▄╶▃▖▖▌▖ ┓ ▁╴⎺▌▌▃▃▃▊▊▁▁▁▁▂▃▃▄ ▄⎺ ╹▆╵▄  ⎻ ▚ ⎼─▃▄▅▄▆▆ ─ ─ ▄▃▂▂▁▂▅▄ ─ ▂▂   
▅▅▆▄▂━━━▄▄▄▄▝ ▌▅╵╴▊  ▒╺│▖▆╺ ▊▃▁▂▃⎻▂▅▅ ▅▂▁▃▂▂▃▃▆▃▃ ▚ ▂▁▁▂▁▁▁ ▆━▅━▆▒──⎼▇▊▄▃▃▆   ▄▃
━⎽⎽▂ ▅▃╺▄⎼─╵━   ┃▌  ⎼╸▝▘▒┓╵▃ ▆▄▃▂▆▄▇▇▇▄▅▄▅▘━▁▇▆▆┳▆ ▚ ▇▅▅▅⎺▃▃▃▃▂▃▁ ▄▆▆▆▅▅▅▅▅▇▆▅▄▅
⎻▁▁▂▂▃▄▃▄▄▃▅▅▎▌▗ ▌⎼ ▄▅▊╹▗▌▎▖▅▅▃▆▂▅▅▅▅▃▂▆▅▅▅▂▄▂▃▆▂┗▂ ▚ ▃▄▄▅▄▅▂▇▗▇▅ ▇▇▇▄ ▁▆▅━▇┻┳━▂
▘▂▂▂▇▅━▂▅▅▆▁⎽▌┓▖▗ ▒ ▇▆▊╵▂▗▝▘▊▄▁▂▃▄▂▆▂▄▂▅▂▗▖▂▆▆▃ ▒▖╴▅ ▝  ▂▁▃▆▂    ▖ ▆▅▁▊ ━▄▃▃▃━╸▅
▄▄▄▅▃▅▃─▇▁⎺ ▒▌▌  ▖▒▃╏▊ ▊▎┗▝▖▌ ▇ ▃▃ ▅▄▄▃▃▃▃▂▂▃▆▁⎽▆▄╵▅ ▝▝ ▗▇▁▁▁▊▃ ▁━ ▁▂▂ ▎▆⎼▂▂▃ ▁─
▗━▅ ▄▁▅▅▁▗⎼▁╵  ▗ ▎   ▎▘▊▎▊▂┓  ▗▁▆▁ ⎺▝⎼▚┓─╵⎼▄ ▘━▂╴─ ╺─ ▝▝ ▅▝▃▃▊ ▅ ▂▇▎╶╴▎▎▁▃╵ ▆▁▒▗
╶⎽▂▂⎽━▌⎺▃▆╵⎼┗▅▎│╵▎▁│ ▊┓  ▎▎▊▊▎▂▅│╴ ▆▒▆╺⎺ ▇▒▊▊ ╴▄─⎼▁▅▃▃▃▝▌▂┛▄▁▘▗ ▊ ▁▂▁ ▊ ⎻┓▁ ▃ ┗┓
▄▄▃▄▄━▄▄▂▊╴⎽▁▊ ▌⎻─  ╸ ▊▌▎ ▗┛ ▎▚ ╸ ▒▓┃▒▒╹  ▁▄ ▃▇▆▇▇╺╸ ╵━▅▝┓ ▅  ▊▘ ▃▂▂▃▝▁▂▄▃╹▒╹ ━▗
▆▅▅▄▅▆▆▄▁┛▅▝▁▃▎┃╵▒▂   ▌╵ ▁▊ ▗  ▒━▅▘│ ▄╴▃▒ ╵⎺ ─▒▅ ▁  ⎺▇⎽│▂▌ ▘ ▊▊▅  ╸▆⎽   ▘━▅━▅┳▎ 
▁▇⎻▝⎻▃▂▝▅ ▁▎▝▗  │⎽⎽▌▊▊▌╵╵▖▁▗ ▂┛▃▒▂▒▒╏⎺▁▘╏ ▅▖▊ ▇▒▁╏╴▗ ╵▊⎺  ▇▎┛┗ ▎╹    ▚▊ ⎼▃▃▁▄▁┳▅
━▎▄▖▅▄▃▆▅▇▆▆▄▎▘▎▇▅▃▂▎▗▘▌╵▗ ▊▃▂▂▁▁╴▝▆⎺▁─⎻╹▆▂▅▘╺▚▂ ▊▅ ▄▄▂ ▘╸▗ ▎▗  ━▃▅  ▊▊ ▖▆▒▂╴▗╴▒
▂▂▁▒▎ ▗▄▄▂▃▂▁▎⎺ ▊▄ ▄▂▄▗╵▌▄▁▝ ▁▁▃▃▅▅▇▆▆▅▄▃▃▃▅▅▁▆▆▃▆━▄▃▃ ▘ ▃ ▚▘▗▅▄▄▃▄▃▝  ▖▊▂▁▖▁  ▆
▅▌▃▇▆▄━ ▂▄▄▄▊▖▗▘▃▁▁▄▊▌▄╵│▌▂╵▎▝▂▗▄▃▄▅▄⎺▂▊▅▖━▅┗▅╸─▁▄▌▌▖  ▆▌▁ ▝▂┏▘╸▖ ▆▃▇  ▘▊▒▎ ╴╴▂╵
▇▂━▗▃▄ ▘╺▆▆▆▌▝▘▊▃▃▄━⎻  ▊ ▆▅▌▅▅▄▄▃▆▃▄▖▃▂▅▅▆▅▄▄▂▆▄▖━▃▌▖▌▊▎⎻━▁ ▘▎▎▄ ┓▁▊ ▗  ▂▒▂⎼▂╴▊▆
⎻▃▘▁⎺⎺▆▅▅▃▅▃▎╺▆⎻▄  ▆▊ ▆▊   ▃  ▅▆▃▆▆▌▄▅▖▌▂▃▃▆▊▊┗▊ ▆▃▊▄▗▅▃ ▖▌▊▆▅▊⎼▊╸ ▖  ▊ ▖▝▃▅▆▆╴ 
 ▆▒▆▆▇▃▌▊▌▌╵▌▎▖ ▅▆▆▃▌▝▃▂ ▅ ▁▌ ▆▅▆▃▂▁▂▁▂▃▁▆▅▄▘▅╸⎺┗▇▝▄▄ ▘▁▊▊▆▌▄ ▆▃ ▄▖▄▌ ▂▁▘┓▃▅▄▄▁▗
⎻ ▁▂ ▖ ▚⎻▆▗▃▌    ▁⎼▗ ▆▆▄▎▅▄▃─╺━  ▆▇▅▄▄▃▄▃▄▄▃━▅▅─▄▃▒▆▊ ▁▗   ▌ ▌▄▄▖▊▗▅ ▎▌▃▅▆▆▖▂▅▆▄
▂▆▆ ▆▆⎽▃▁▂▂▁▊ ▌⎽    ▖▁▁▗▎ ▘▌ ▆▅▝▎▊▎▚▅┛╶▝▄▆▄▆▅⎼▗ ▂ ▁▁ ▃▄ ▝▄▌▝▌▖▌▚  ▝ ▝▅▊▅▄╹▃▌▅▌ ▅
▌▖▅▅▎▝  ▄▃▅▄     ╴▁▂▘ ▌┗▎▎▂▌▖╴╺⎽ ▅▆▌ ▁▁▁▗╴▘▚▆▆ ━╺ ▃▃ ▆━▗ ▄ ▒▝▖▝ ▆▝ ▎▅▄▄▂▚▖▃▃▄━▎▗
▆▖─▖▝▌▝▄▄▃⎻ ▇▝▂▂▃▘▂ ▁▄▂ ▎▎▆▂▌▝▚▂ ▄ ▅▄▄╺ ▃▂ ▊▗▆▂▃▆▁▝▄▂ ▆⎺ ━ ▖▊▊  ▝▃▘▝▃▄╸▘▌▎▁┏▌▂▎ 
▁┓▚▅▄━▗▒▁▄▇▅▂▆▝▆▆▇   ▆━╸▌▎▄▌▎▇▆┏ ▂▘▁▂ ▒▁▅│▝▆▖▝▂┏▄▁▂▄▄▒▂▆▆  ▄▃ ▅▂▅ ▆▄▇▘▎▂▂▂▅▆▄▄▂▄
▃▄▅╸▘╺▅▅▇▆▅▂▒▁▃ ▇▁▆▅▚▌┓▗▌▌▄▁▘┏▘▇ ▘▒▅▊▒▆▄▅▅▄━▖┗▘ ▘▅╵▝┗▅▂▆▄▌▇▅▂┻▄▃▃▃▄▅▖▄▁▆▅▆╵▂▆▂▁▂
▅▇▆▅⎻▗▂▃▇▊┛▊▌▇▅▄▃▝▁▖▅ ▊▆▌▌▎▅╺━▖▃▅▂▘▘▝▃╴▂▎▘▊▊┃▂┻╸╶━⎽▁▁▂▂▁▁ ▂▂▃▖ ▃▂ ▊╵ ▄▆▊▘▁▊⎼▌▃▆▝
┓▁▁▄ ▃⎺▆▒▅▄▃▃▁━▅ ─▅▄▃▅▆▂▊▌▁▁⎽━▃▃▆▆▌ ▃━▁┗▂▘╹▊▁▇▎▂▅┃▇▆▆▄▌ ━▂▘   ▎▖▎▃▘▁▁ ▃ ▄▂▃▂▊▘⎼│
▂⎻▅▂▁▁▆▆▁ ▂╹▗▚⎺━▂▁▂▂▃ ▅┗▊▌▃▅▁▌▅ ▃▗▅┗▆▂▗━▅┗▄▝▅  ▗▂╸▂▁▂▊ ╸▁▅▝▊▌ ▅╺▃▄▗▆ ▗╏╵▖▃▃▃▌▄▗▚
▘▒▂▄▒╸▃▅▂╏▘━▃▄▆▅▅▆▅▄▂▄▃─ ▊▎╺▇▅▇▝ ┏━⎼╴▆▂▌▌▅▖▊▌▆▝▄▆▁ ╴▗╺▁▅▁▖▁▝▇▅▃▂▄▂⎼   ▌ ▆▊▃▅▄╸▗━
 ▝▝▃╴▇▗▂▃▄ ▄▊ ▃▄▄▄▄▄▄▄▄╴▅╵▎▃╹▁ ▃▘▅▅▆▌▄▗▂╵▘▝▅▚▄ ▃▄╸╶▃▂▃▘━▄▅▖▆▇▇▂▆▆▇▆ ▄▘▃▃▃▁▅▌▌▎▅▊
▂▂╵▄▘▆▅▇▇▅▆▊▂▃▃▖▌▌│▅▖ ▃ ▂▗▎▖▝▂▌▂▃▅⎻▝▅▆ ▆┏▂▃┓▘▒▌▂▄▄▁▅▅▅▁▆▊▁▌ ▆┏▌▊▅▄▅▄▅▅▇ ▆▃▎▝▄▘▘ 
▗▆▆▆ ▎▌▄▘▇┓╵▄▃┓▌▁▝▝ ▃▁▂  ▅  ▇ ━▄▘▂▂▃▄▄▄▄▅▃▆┃▖▌▌▊▁▂▃▄━─▖ ▄╴▖▗▆▂╹▄▄▃▁ ╴▝▅▅▆▂▅▁▄▅╵▃
▂▁ ─▝ ┻▅▊▇▅ ┛ ▁▁▂▁▁▁▃▃▝▁▂▆▒▅▖▄▅▄▘▃▘╺▁⎽▖▄▄▗⎻▅▇▒┃▃▄▄▄▘▄─▝▄▁▆▃▇▄▂▂▁╴╹▅▆▁▂▂▃▅▇▇▂▃▄▅━
▂▅▆▄▅─▅▄▃▄╴▅▄▅▆▇▄▂▆▄▄▅━━▂▂─▁▁▂━▆▊▆▃▊⎼▗▘▇▝▌▚▌▃▂▘▁▚▆┓━▄▅▆▅▅▘▘▗▁ ▒▅▂▃▄▆━▃▄▆━▂▂▅▅▇▂▂
▅╸╵▂▎▝▅▖──▒━▗▃▘▝▁▝▊▁▂▁▚▄▄▝╺━▄▌▁ ▊▌▅▁▆▆▅▄▃▂▄─▊━▂▗▃ ▁ ┃▝▂▂▁▂▁▌▃╋▂ ▗▄▂▄▄┏▁▄▂▂▃▃▅▅┃▄
┛▅▂▆▅▖▃╸▝▆▅▅▅▆ ▒╶▄▆▌▅▆▘▌▗▄▄▄▂▁▝▃▂┓╺ ▄▃▅▅┛▃▒▃▒▄▂▊▂▅▄▌▅▂▄▆▂▃▘▁▌▎⎻▅▁▆▄▆▃▅▎▆▂▃━╴ ▌▂╵
▎ ▅▃▃▂▂▃▃ ╹▂▃▌▗▃▒▇  ▎▗▄▌▝▂▎▁▘▂┓─▄▂▂▄▄▄▅▄━▎▄▆▃━╹▎▌▅▅┏▝▄▆▃▁▅─▂▆▆▄▅▅▅━▎▄▆▗▎▄▃▆▂▄⎼┗▃
╵╹▝▁▘⎼╏ ▂▂╴ ▝ ▝▄▅▃▎╴▆▃┗⎼▂▅▅╴▌│▘▗▁▝ ▎▅▄▅▊▒▂▒▂⎽▆▇▚▒▊ ▃▃▂▁▃▖▖▗▅▖┛▄▅ ▘┓▄▄▂▄▘▁▄╵▊▃▎┗⎼
▄▂▂▃▂▃▎▝▂▄▃╵▇ ▂▊▄▁▌▂▂▂▄▌▖▂ ▄▎▊▂▅─▆▄▂▄▃▆▚▁▃⎺▄▆▂▚╶▄▊▅▂▄▃▆▄▖▘▗▇▁▌▊▘▆▁▂▁▊ ▗▆╴▂▗▂╵▄▇▌
⎽▄▅▆▖━▃━▒▂▅┳╴▁━▂▂▂▆ ┻▄▁▊╺━⎼▂ ▃▚▂ ▊ ▄▄▆▆▄  ╴▁ ▊▂▂▗▅▂⎼▃▂▅▄▗▄▂▆▌▆▊▄▎╴▆▅▆╴ ▒┛▂▆⎻▂▌▌▝
▂▁▁▝▆▁ ▅▆━▃▆▇⎻▄▄▆▇┓│━▂▆ ▅▁│▖▂▎▌╏▌▝ ▄▃▆━▄▘▃▃▄▖▌▝▘▂▌▗▗▄▁▁ ▌▃▁▌ ┃▃▄▗▃▊▂▝ ▁ │▅┏▂╴▅▂▊
▎▆▅▄▌▃▃▂▎▄┏▄▆▁▗▂▖▂▁▅▒▊▃▃▃▄▃▂▃▂▁ ╸▎▇▁▅▃▂▁━▘╵━▒▊▎▌▆▃▄▇▇▇▗▂ ▆┏ ▎▂▄▁ ▃▝▎▎▃▆▅╏▇▂▂┏▄▄▂
▂▅▊▃▌▃╵▂▂▄▄▆▇▄▃▄▇▄▄▄▂▌╺▅▃▂▌▝▘▗▂▇▅▂▃▄━▂▌▝━▎▂╏▂▘▗ ▊▊⎽ ▗▂▒╸╵▃▅▁▂▄▖▎▊▗▄▒▎▌ ▄╏▂▎▃▘▌ ▃
▃▂▆▆▇▌▘ ▇▎▊▗▄┓▂▂▁▝▘▌▘ ▁▌▂╸▆▂▊▂┓▃▃▖▊▆▆▃▚▃▒▁▂▃▎ ▎▂▊▄▅▌▌▝▂▅▆▖ ▝▒▃▅╸▌▁▁━▂▄▅━━▅▘▁▁▝▄▂

real    0m0.018s
user    0m0.000s
sys 0m0.004s
stefanhaustein commented 8 years ago

I think the main bottleneck is starting the JVM. Would it help if the program was able to convert multiple images in one run?

certik commented 8 years ago

I was thinking of using your program to write something like the Gnome's eog program for a terminal. So the user presses left/right arrows, and it shows the next image, in a curses app. So it's be nice to somehow make this run a lot faster. I don't know what the options are with JVM.

stefanhaustein commented 8 years ago

I could add a parameter that would make the program read image names from stdin, this would allow you to keep the process running? Real solution probably would be to port the code to C or C++....

certik commented 8 years ago

I think that would work. Thanks!

Indeed, I was thinking of porting this to C++, but since you already did the work, I wanted to use your code if we can make it run a bit faster.

Sent from my mobile phone. On Jul 10, 2016 6:56 AM, "Stefan Haustein" notifications@github.com wrote:

I could add a parameter that would make the program read image names from stdin, this would allow you to keep the process running? Real solution probably would be to port the code to C or C++....

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/stefanhaustein/TerminalImageViewer/issues/6#issuecomment-231587685, or mute the thread https://github.com/notifications/unsubscribe/AABQWHtX5WVmAHOwWelT84NF0IOLdlKLks5qUOwXgaJpZM4JIemR .

stefanhaustein commented 8 years ago

Ok, this should work now (haven't really tested) O:)

stefanhaustein commented 8 years ago

Please reopen or create a new bug if you run into any issues.

certik commented 8 years ago

Thanks @stefanhaustein. In the meantime, I created a terminal image viewer using your old code: https://gist.github.com/certik/5158d45b9d1c99b9dbe988dd0f12b228, it's just a simple script that allows you to browse the images in the directory that you give it on a command line. I am now at the SciPy 2016 conference, I'll show it to other people and see what they think.

certik commented 8 years ago

GitHub lost my gist... It now says 404 not found. Anyway, I reposted it here: https://gitlab.com/snippets/22365