181 lines
6.6 KiB
HTML
181 lines
6.6 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'; style-src 'self'; font-src 'self' data:; img-src 'self' data:; connect-src 'self'; base-uri 'self'; form-action 'self' https://defcon.social https://bsky.app;">
|
|
<meta http-equiv="X-Content-Type-Options" content="nosniff">
|
|
<link rel="stylesheet" href="../assets/css/style.css">
|
|
<link rel="icon" type="image/x-icon" href="../favicon.ico">
|
|
<script>
|
|
// Apply theme immediately to prevent flash
|
|
(function() {
|
|
const theme = localStorage.getItem('theme') ||
|
|
(window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
|
|
document.documentElement.setAttribute('data-theme', theme);
|
|
})();
|
|
</script>
|
|
<title>chafa Cheatsheet - Cheatsheets - Launch Pad</title>
|
|
</head>
|
|
<body>
|
|
<button class="theme-toggle" id="themeToggle" aria-label="Toggle dark mode">
|
|
<svg class="theme-icon theme-icon-moon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"></path></svg>
|
|
<svg class="theme-icon theme-icon-sun" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="display: none;"><circle cx="12" cy="12" r="5"></circle><line x1="12" y1="1" x2="12" y2="3"></line><line x1="12" y1="21" x2="12" y2="23"></line><line x1="4.22" y1="4.22" x2="5.64" y2="5.64"></line><line x1="18.36" y1="18.36" x2="19.78" y2="19.78"></line><line x1="1" y1="12" x2="3" y2="12"></line><line x1="21" y1="12" x2="23" y2="12"></line><line x1="4.22" y1="19.78" x2="5.64" y2="18.36"></line><line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line></svg>
|
|
</button>
|
|
<br/><br/>
|
|
<div class="name">
|
|
__ _______________________ _________._________________________
|
|
\_ _____/ \______ \ / _ \ / _____/ / _____/ | | \_ _____/
|
|
| __) | _/ / /_\ \ / \ ___ / \ ___ | | | __)_
|
|
| \ | | \ / | \ \ \_\ \ \ \_\ \ | |___ | \
|
|
\___ / |____|_ / \____|__ / \______ / \______ / |_______ \ /_______ /
|
|
\/ \/ \/ \/ \/ \/ \/
|
|
</div>
|
|
<div class="blog-page-header">
|
|
<div class="blog-header-content">
|
|
<a href="/cheatsheets" class="back-link" title="Back to Cheatsheets">
|
|
<svg xmlns="http://www.w3.org/2000/svg" width="42" height="42" viewBox="0 0 24 24" class="home-icon"><path fill="currentColor" d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/></svg>
|
|
</a>
|
|
<h1 class="blog-page-title">chafa Cheatsheet</h1>
|
|
</div>
|
|
</div>
|
|
<div class="blog-post-container">
|
|
<div class="blog-posts-container" style="max-width: 900px; margin: 0 auto;">
|
|
<div class="blog-post">
|
|
<div class="blog-post-content">
|
|
<p><a href="index.html">← Back to cheatsheets</a></p>
|
|
<p><a href="../index.html">← Home</a></p>
|
|
<hr>
|
|
<p>chafa is a terminal image viewer and converter. Converts images to ANSI art, Unicode blocks, or sixel graphics for display in terminals.</p>
|
|
<hr>
|
|
<h2>Basic Usage</h2>
|
|
<ul>
|
|
<li>chafa <image> - Display image in terminal</li>
|
|
</ul>
|
|
<ul>
|
|
<li>chafa -f <format> <image> - Specify output format</li>
|
|
</ul>
|
|
<ul>
|
|
<li>chafa -s <size> <image> - Set output size</li>
|
|
</ul>
|
|
<ul>
|
|
<li>chafa -c <colors> <image> - Set color mode</li>
|
|
</ul>
|
|
<hr>
|
|
<h2>Output Formats</h2>
|
|
<ul>
|
|
<li>chafa -f symbols <image> - Unicode symbols (default)</li>
|
|
</ul>
|
|
<ul>
|
|
<li>chafa -f sixel <image> - Sixel graphics</li>
|
|
</ul>
|
|
<ul>
|
|
<li>chafa -f kitty <image> - Kitty terminal protocol</li>
|
|
</ul>
|
|
<ul>
|
|
<li>chafa -f iterm2 <image> - iTerm2 protocol</li>
|
|
</ul>
|
|
<ul>
|
|
<li>chafa -f none <image> - No output (for testing)</li>
|
|
</ul>
|
|
<hr>
|
|
<h2>Size Options</h2>
|
|
<ul>
|
|
<li>chafa -s <width>x<height> <image> - Set dimensions</li>
|
|
</ul>
|
|
<ul>
|
|
<li>chafa -s <size> <image> - Set size (width only, auto height)</li>
|
|
</ul>
|
|
<ul>
|
|
<li>chafa -s auto <image> - Auto size based on terminal</li>
|
|
</ul>
|
|
<ul>
|
|
<li>chafa -s max <image> - Maximum size</li>
|
|
</ul>
|
|
<hr>
|
|
<h2>Color Options</h2>
|
|
<ul>
|
|
<li>chafa -c 16 <image> - 16 colors</li>
|
|
</ul>
|
|
<ul>
|
|
<li>chafa -c 256 <image> - 256 colors</li>
|
|
</ul>
|
|
<ul>
|
|
<li>chafa -c full <image> - Full color (24-bit)</li>
|
|
</ul>
|
|
<ul>
|
|
<li>chafa -c none <image> - No color (monochrome)</li>
|
|
</ul>
|
|
<hr>
|
|
<h2>Display Options</h2>
|
|
<ul>
|
|
<li>chafa --animate <image> - Animate GIF/APNG</li>
|
|
</ul>
|
|
<ul>
|
|
<li>chafa --center <image> - Center image</li>
|
|
</ul>
|
|
<ul>
|
|
<li>chafa --bg <color> <image> - Set background color</li>
|
|
</ul>
|
|
<ul>
|
|
<li>chafa --fg <color> <image> - Set foreground color</li>
|
|
</ul>
|
|
<ul>
|
|
<li>chafa --dither <mode> <image> - Set dithering mode</li>
|
|
</ul>
|
|
<ul>
|
|
<li>chafa --threshold <value> <image> - Set threshold for symbols</li>
|
|
</ul>
|
|
<hr>
|
|
<h2>Common Examples</h2>
|
|
<h3>Basic Display</h3>
|
|
<pre><code>chafa image.png</code></pre>
|
|
<p>Display image in terminal.</p>
|
|
<h3>Custom Size</h3>
|
|
<pre><code>chafa -s 80x40 image.png</code></pre>
|
|
<p>Display at specific dimensions.</p>
|
|
<h3>Sixel Format</h3>
|
|
<pre><code>chafa -f sixel image.png</code></pre>
|
|
<p>Use sixel graphics format.</p>
|
|
<h3>Full Color</h3>
|
|
<pre><code>chafa -c full -s 100 image.png</code></pre>
|
|
<p>Full color at 100 width.</p>
|
|
<h3>Animated GIF</h3>
|
|
<pre><code>chafa --animate animation.gif</code></pre>
|
|
<p>Display animated GIF.</p>
|
|
<h3>Monochrome</h3>
|
|
<pre><code>chafa -c none image.png</code></pre>
|
|
<p>Display in monochrome.</p>
|
|
<hr>
|
|
<h2>Tips</h2>
|
|
<ul>
|
|
<li>Use -s auto for automatic sizing based on terminal</li>
|
|
</ul>
|
|
<ul>
|
|
<li>Use -c full for best color quality in modern terminals</li>
|
|
</ul>
|
|
<ul>
|
|
<li>Use -f sixel for better quality in terminals that support it</li>
|
|
</ul>
|
|
<ul>
|
|
<li>Use --animate to view animated images</li>
|
|
</ul>
|
|
<ul>
|
|
<li>Works great with image previewers in file managers</li>
|
|
</ul>
|
|
<ul>
|
|
<li>Can be piped to other commands for processing</li>
|
|
</ul>
|
|
<ul>
|
|
<li>Supports many image formats: PNG, JPEG, GIF, WebP, etc.</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<script async type="text/javascript" src="../blog/analytics.js"></script>
|
|
<script src="../theme.js"></script>
|
|
</body>
|
|
</html>
|
|
|