<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Coder Legion - Recent posts tagged screenshot</title>
<link>https://coderlegion.com/tag/screenshot</link>
<description>Powered by Question2Answer</description>
<item>
<title>wsnap — macOS-style screen capture for Windows</title>
<link>https://coderlegion.com/19583/wsnap-macos-style-screen-capture-for-windows</link>
<description>&lt;p&gt;Ever taken a screenshot only to fish the file out of a folder afterward — or thought you copied the image but got a file path instead? wsnap is a native Windows capture tool built around the two things people actually do with a screenshot: paste it and drag it.&lt;/p&gt;
&lt;p&gt;Press Shift+F1 and drag a region. The instant you release the mouse, the image is on your clipboard — paste it anywhere with Ctrl+V. The floating thumbnail at the bottom-right is a real, draggable file: drop it into Slack, a chat, an editor, or an email. It stays put, so you can drop it again somewhere else.&lt;/p&gt;
&lt;p&gt;Beyond that core:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Precise overlay — freezes the screen, brightens only your selection, shows live W×H, and a magnifier loupe with pixel coordinates and the HEX color under the cursor.&lt;/li&gt;
&lt;li&gt;Annotation editor — arrow, shapes, pen, highlighter, text, numbered steps, mosaic/blur redaction, crop, with undo/redo.&lt;/li&gt;
&lt;li&gt;On-device OCR (Korean + English) — PaddleOCR PP-OCRv5, fully offline, no language pack needed.&lt;/li&gt;
&lt;li&gt;Many capture modes — region, full screen, click-to-capture a window, delayed, scrolling capture, GIF recording.&lt;/li&gt;
&lt;li&gt;Capture history gallery, color picker (eyedropper), and filename templates.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;No account, no tracking, fully offline. It runs quietly from the tray with a minimal idle footprint. GPL-3.0 open source.&lt;/p&gt;
&lt;p&gt;Available for Windows 10/11 (x64) via Scoop, winget, or direct download.&lt;/p&gt;
&lt;p&gt;GitHub: &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/openwong2kim/wsnap&quot;&gt;https://github.com/openwong2kim/wsnap&lt;/a&gt;&lt;/p&gt;
</description>
<category>Articles</category>
<guid isPermaLink="true">https://coderlegion.com/19583/wsnap-macos-style-screen-capture-for-windows</guid>
<pubDate>Wed, 03 Jun 2026 12:42:49 +0000</pubDate>
</item>
<item>
<title>GIF Screen Recording on Linux</title>
<link>https://coderlegion.com/18975/gif-screen-recording-on-linux</link>
<description>&lt;h3 id=&quot;overview&quot;&gt;Overview&lt;/h3&gt;
&lt;p&gt;I recently realized how challenging it is to illustrate my application's functionality in documentation. Screenshots provide only static images, while videos are large and need hosting on platforms like YouTube. GIFs offer a practical middle ground. However, using a Linux machine restricted me to either online MP4 to GIF converters or awkward browser add-ons.&lt;/p&gt;
&lt;p&gt;In this tutorial, we will learn how to create a GIF from a screen recording on Linux. We'll start by learning how to capture screen recording using &lt;code&gt;FFmpeg&lt;/code&gt;, a command line toolbox to manipulate, convert and stream multimedia content. Later, we will use &lt;code&gt;FFmpeg&lt;/code&gt; to convert the recording to GIF.&lt;/p&gt;
&lt;h3 id=&quot;screen-recording-ffmpeg&quot;&gt;Screen Recording: &lt;code&gt;FFmpeg&lt;/code&gt;&lt;/h3&gt;
&lt;p&gt;&lt;code&gt;X11&lt;/code&gt; (also known as the &lt;code&gt;X Window System&lt;/code&gt;) is a standard networking display protocol that provides the framework for building graphical user interfaces (GUIs) on Linux and other Unix-like operating systems. FFmpeg uses a dedicated input device called &lt;code&gt;x11grab&lt;/code&gt; to interact with X11.&lt;/p&gt;
&lt;p&gt;Enough of the technical jargon. Let's record our primary display using FFmpeg:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ffmpeg -f x11grab -y -framerate 20 -s 1920x1080 -i :0.0 -c:v libx264 -preset superfast -crf 18 video_file.mp4
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;-f&lt;/code&gt;: Specifies the input format (x11grab) to allow screen capture on X11&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-y&lt;/code&gt;: Overwrites output file with the same name without prompting&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-framerate&lt;/code&gt;: Indicates the frame rate to use. 20 is good for demos&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-s&lt;/code&gt;: Sets the resolution of the &quot;canvas&quot; to be captured. Adjustable as required&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-i&lt;/code&gt;: The input display source, :0.0 for the primary monitor&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-c:v&lt;/code&gt;: The audio codec to use for the output format. x264 is the gold standard for MP4 compatibility&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-preset&lt;/code&gt;: Tells the CPU to prioritize encoding speed over file size. Crucial for live recording so you don't drop frames&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-crf&lt;/code&gt;: &quot;Constant Rate Factor&quot; refers to video quality. 18 is visually lossless&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Lower &lt;code&gt;crf&lt;/code&gt; values produce a high-quality video at the expense of file size. The value ranges between 0 and 51, where 0 means &quot;lossless&quot;.&lt;/p&gt;
&lt;p&gt;I have named the resulting file &lt;code&gt;video_file.mp4&lt;/code&gt;. You can give the file a name of your choice.&lt;/p&gt;
&lt;p&gt;You may want to capture the entire screen but are not sure of the screen resolution. In that case, you can use &lt;code&gt;xdpyinfo&lt;/code&gt; to grab the screen resolution dynamically:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;xdpyinfo | grep dimensions | awk '{ print $2 }'
1920x1080
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Then inject this handy snippet in the command to substitute the value for &lt;code&gt;-s&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ffmpeg \
    -f x11grab \
    -y \
    -framerate 20 \
    -s &quot;\((xdpyinfo | grep dimensions | awk '{ print \)2 }' )&quot; \
    -i :0.0 \
    -c:v libx264 \
    -preset superfast \
    -crf 18 \
    video_file.mp4
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Once the recording is complete, terminate the process using &lt;code&gt;CTRL+C&lt;/code&gt;. FFmpeg quits gracefully.&lt;/p&gt;
&lt;h3 id=&quot;convert-screen-recording-to-gif&quot;&gt;Convert Screen Recording to GIF&lt;/h3&gt;
&lt;p&gt;Once the video is recorded, we can convert it to GIF using FFmpeg:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ffmpeg -i video_file.mp4 \
    -vf &quot;fps=10,scale=800:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse&quot; \
    -loop 0 gif_file.gif
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;-i&lt;/code&gt;: The &lt;strong&gt;input&lt;/strong&gt; source. In this case the recorded video&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-vf&lt;/code&gt;: This defines the &lt;strong&gt;video filters&lt;/strong&gt;. This part uses &lt;strong&gt;filtergraph&lt;/strong&gt;. Instead of a simple conversion, it runs the video through a series of &quot;rooms&quot; to process it. The settings are further explained below this list&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-loop&lt;/code&gt;: Indicates the number of counts to loop the GIF. 0 means the GIF will loop indefinitely. If set to -1, it would play once and stop.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Here is the breakdown of the &lt;code&gt;-vf&lt;/code&gt; settings:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;fps=10&lt;/code&gt;: Drops the framerate. High FPS makes GIFs huge and hard to load; 10–15 is the &quot;sweet spot&quot; for demos.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;scale=800:-1&lt;/code&gt;: Resizes the width to 800px. The -1 tells ffmpeg to calculate the height automatically to keep the aspect ratio perfect. The ideal scale for a GIF depends on where you plan to use it, as GIF file sizes explode quickly at high resolutions. Generally, a width between 320px and 800px is the standard range for web and social media.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;flags=lanczos&lt;/code&gt;: Uses a high-quality scaling algorithm (Lanczos) that&lt;br&gt;
keeps edges sharp, preventing the GIF from looking blurry.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The &quot;Magic&quot; Palette Logic:&lt;/p&gt;
&lt;p&gt;Standard GIFs are limited to &lt;strong&gt;256 colors&lt;/strong&gt;. Usually, a generic palette makes the video look grainy. This logic fixes that:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;code&gt;split[s0][s1]&lt;/code&gt;: Takes the input video and creates two identical temporary streams (&lt;code&gt;s0&lt;/code&gt; and &lt;code&gt;s1&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;[s0]palettegen[p]&lt;/code&gt;: Takes the first stream and analyzes every single frame to find the best possible 256 colors for your specific video. It saves this as a &quot;palette&quot; map named &lt;code&gt;[p]&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;[s1][p]paletteuse&lt;/code&gt;: Takes the second stream and the custom palette map, then merges them. This ensures your GIF uses the most accurate colors possible.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Summary of the Flow&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Grab&lt;/strong&gt; pixels from the screen.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Compress&lt;/strong&gt; them quickly using H.264 so the CPU doesn't lag.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Re-sample&lt;/strong&gt; that video to a lower frame rate (to save space).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Scan&lt;/strong&gt; the colors to build a custom &quot;paint box&quot; (the palette).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Paint&lt;/strong&gt; the GIF using only those specific colors.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&quot;combining-the-commands&quot;&gt;Combining the Commands&lt;/h3&gt;
&lt;p&gt;Running these commands separately can get quite taxing. We can use a bash script to combine the commands in one tool kit:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; #!/bin/bash

 # 1. Dynamically generate names of files 
NAME=$(date +'%Y-%m-%d_%H-%M-%S')
MP4_FILE=&quot;${NAME}.mp4&quot;
GIF_FILE=&quot;${NAME}.gif&quot;

 # 2. Start Recording
echo &quot;--- Recording started: $MP4_FILE ---&quot;
echo &quot;Press 'q' to stop recording...&quot;

ffmpeg -f x11grab -y -framerate 20 -s 1920x1080 -i :0.0 \
       -c:v libx264 -preset superfast -crf 18 &quot;$MP4_FILE&quot;

 # 3. Convert to High-Quality GIF
echo &quot;--- Recording stopped. Converting to GIF: $GIF_FILE ---&quot;

ffmpeg -i &quot;$MP4_FILE&quot; -vf \
&quot;fps=10,scale=800:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse&quot; \
-loop 0 &quot;$GIF_FILE&quot;

echo &quot;--- Done! Created $GIF_FILE ---&quot;

 # 4. Delete video file (optional)
rm &quot;$MP4_FILE&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This script will handle the heavy work for you. Below is a demo of the script at work:&lt;br&gt;
&lt;img src=&quot;https://coderlegion.com/?qa=blob&amp;amp;qa_blobid=6861449561043895789&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
</description>
<category>Articles</category>
<guid isPermaLink="true">https://coderlegion.com/18975/gif-screen-recording-on-linux</guid>
<pubDate>Tue, 26 May 2026 11:00:21 +0000</pubDate>
</item>
</channel>
</rss>