Top Related Projects
Cross-platform, fast, feature-rich, GPU based terminal
A VIM-inspired filemanager for the console
🖼️ A command-line system information tool written in bash 3.2+
ripgrep recursively searches directories for a regex pattern while respecting your gitignore
A simple, fast and user-friendly alternative to 'find'
:cherry_blossom: A command-line fuzzy finder
Quick Overview
Ueberzug is a library for displaying images in the terminal using X11. It provides a simple and lightweight alternative to other image display solutions, making it suitable for use in terminal-based applications and scripts.
Pros
- Lightweight and Efficient: Ueberzug is a lightweight library that doesn't require any additional dependencies, making it easy to integrate into existing projects.
- Cross-platform Compatibility: Ueberzug works on various Unix-like operating systems, including Linux and macOS, providing a consistent image display experience across different platforms.
- Customizable Appearance: Ueberzug allows users to customize the appearance of the displayed images, including the ability to set the background color and transparency.
- Scriptable Interface: Ueberzug provides a scriptable interface, making it easy to integrate into shell scripts and other terminal-based applications.
Cons
- Limited Image Formats: Ueberzug currently supports only a limited number of image formats, such as PNG and JPEG, which may be a limitation for some users.
- Dependency on X11: Ueberzug requires the X11 windowing system to be installed and running, which may not be available on all systems, particularly in containerized environments.
- Potential Performance Issues: Depending on the size and number of images being displayed, Ueberzug may experience performance issues, especially on older or less powerful hardware.
- Lack of Advanced Features: Compared to some other image display solutions, Ueberzug may lack more advanced features, such as support for animations or image manipulation.
Code Examples
import ueberzug.lib.v0 as ueberzug
import time
# Create a new canvas
canvas = ueberzug.Canvas()
# Add an image to the canvas
image = canvas.create_placement(
"my_image",
x=10,
y=10,
width=100,
height=100,
path="path/to/image.png"
)
# Update the canvas to display the image
canvas.apply()
# Wait for a few seconds
time.sleep(5)
# Remove the image from the canvas
image.destroy()
# Update the canvas to remove the image
canvas.apply()
This code demonstrates how to use Ueberzug to display an image in the terminal.
import ueberzug.lib.v0 as ueberzug
# Create a new canvas
canvas = ueberzug.Canvas()
# Add multiple images to the canvas
image1 = canvas.create_placement(
"image1",
x=10,
y=10,
width=100,
height=100,
path="path/to/image1.png"
)
image2 = canvas.create_placement(
"image2",
x=120,
y=10,
width=100,
height=100,
path="path/to/image2.png"
)
# Update the canvas to display the images
canvas.apply()
This code demonstrates how to display multiple images using Ueberzug.
import ueberzug.lib.v0 as ueberzug
# Create a new canvas
canvas = ueberzug.Canvas()
# Add an image with a custom background color
image = canvas.create_placement(
"my_image",
x=10,
y=10,
width=100,
height=100,
path="path/to/image.png",
scaler=ueberzug.ScalerOption.CONTAIN,
scaling_position_x=ueberzug.XPosition.CENTER,
scaling_position_y=ueberzug.YPosition.CENTER,
background_color="#000000"
)
# Update the canvas to display the image
canvas.apply()
This code demonstrates how to customize the appearance of an image displayed using Ueberzug, including setting the background color and scaling options.
Getting Started
To get started with Ueberzug, follow these steps:
- Install the required dependencies:
- X11 libraries (e.g.,
libx11-dev
,libxext-dev
) - Python 3 and the `python
- X11 libraries (e.g.,
Competitor Comparisons
Cross-platform, fast, feature-rich, GPU based terminal
Pros of kitty
- Full-featured terminal emulator with GPU acceleration
- Built-in image viewing capabilities
- Extensive customization options and scripting support
Cons of kitty
- Larger codebase and more complex setup
- Not specifically designed for image overlays in other applications
Code comparison
kitty
from kitty.fast_data_types import Screen
from kitty.tab_bar import DrawData, ExtraData, TabBarData
def draw_tab(
draw_data: DrawData,
screen: Screen,
tab: TabBarData,
before: int,
max_title_length: int,
index: int,
is_last: bool,
extra_data: ExtraData
) -> int:
# Tab drawing implementation
ueberzug
import ueberzug.lib.v0 as ueberzug
with ueberzug.Canvas() as c:
path = "path/to/image.png"
placement = {
'x': 0,
'y': 0,
'scaler': ueberzug.ScalerOption.FIT_CONTAIN.value,
}
c.create_placement('image', path, **placement)
Summary
Kitty is a full-featured terminal emulator with built-in image viewing capabilities, while ueberzug is a lightweight tool specifically designed for displaying images in terminal applications. Kitty offers more extensive features and customization options, but ueberzug provides a simpler solution for image overlays in various terminal-based applications.
A VIM-inspired filemanager for the console
Pros of ranger
- Full-featured file manager with extensive functionality
- Highly customizable with Python scripting
- Large and active community for support and plugins
Cons of ranger
- Heavier resource usage compared to lightweight image viewers
- Steeper learning curve for advanced features
- Not specifically designed for image previews
Code comparison
ranger:
def draw(self, path, img, x, y, width, height):
self.fm.ui.browser.draw_image(path, img, x, y, width, height)
ueberzug:
import ueberzug.lib.v0 as ueberzug
with ueberzug.Canvas() as c:
demo = c.create_placement('demo', x=0, y=0, width=90, height=45)
demo.path = '/path/to/image.jpg'
demo.visibility = True
Key differences
- Ranger is a full file manager, while ueberzug focuses on image rendering
- Ueberzug provides more advanced image display capabilities
- Ranger has a broader scope of features beyond image handling
- Ueberzug can be integrated into various terminal applications, including ranger
Use cases
- Choose ranger for a comprehensive file management solution
- Opt for ueberzug when requiring high-quality image previews in terminal applications
- Consider using both together for enhanced image viewing within ranger
🖼️ A command-line system information tool written in bash 3.2+
Pros of neofetch
- Broader system information display, including OS, hardware, and software details
- More customizable output with various display options and themes
- Wider compatibility across different Unix-like systems
Cons of neofetch
- Primarily focused on system information display, not image rendering
- Less suitable for integrating images into terminal-based applications
- May require additional tools for image display in some environments
Code comparison
neofetch:
#!/usr/bin/env bash
# Fetch system information
print_info() {
info title
info underline
info "OS" distro
info "Host" model
info "Kernel" kernel
info "Uptime" uptime
info "Packages" packages
info "Shell" shell
info "Resolution" resolution
info "DE" de
info "WM" wm
info "WM Theme" wm_theme
info "Theme" theme
info "Icons" icons
info "Terminal" term
info "Terminal Font" term_font
info "CPU" cpu
info "GPU" gpu
info "Memory" memory
}
ueberzug:
import ueberzug.lib.v0 as ueberzug
with ueberzug.Canvas() as c:
demo = c.create_placement('demo', x=0, y=0, scaler=ueberzug.ScalerOption.FIT_CONTAIN.value)
demo.path = '/path/to/image.png'
demo.visibility = ueberzug.Visibility.VISIBLE
input()
The code snippets demonstrate the different focus areas of each project. neofetch is centered around gathering and displaying system information, while ueberzug provides a Python interface for rendering images in the terminal.
ripgrep recursively searches directories for a regex pattern while respecting your gitignore
Pros of ripgrep
- Significantly faster search performance, especially for large codebases
- Supports a wide range of file types and encoding formats
- Highly customizable with numerous command-line options
Cons of ripgrep
- Limited to text-based searching and doesn't handle image display
- May require more setup and configuration for specific use cases
- Lacks built-in preview functionality for non-text files
Code Comparison
ripgrep:
use grep_regex::RegexMatcher;
use grep_searcher::Searcher;
use grep_searcher::sinks::UTF8;
let matcher = RegexMatcher::new(r"foo.*bar").unwrap();
let mut searcher = Searcher::new();
searcher.search_path(&matcher, "path/to/file", UTF8(|_, line| {
println!("{}", line);
Ok(true)
})).unwrap();
ueberzug:
import ueberzug.lib.v0 as ueberzug
with ueberzug.Canvas() as c:
demo = c.create_placement('demo', x=0, y=0, width=90, height=90)
demo.path = '/path/to/image.png'
demo.visibility = ueberzug.Visibility.VISIBLE
Note: The code snippets demonstrate the core functionality of each tool, with ripgrep focusing on text searching and ueberzug on image display.
A simple, fast and user-friendly alternative to 'find'
Pros of fd
- Written in Rust, offering better performance and memory safety
- Provides colorized output and smart case sensitivity by default
- Offers parallel directory traversal for faster searches
Cons of fd
- Limited to file and directory searches, lacks image handling capabilities
- Does not provide image rendering or manipulation features
- May require additional tools for more complex file operations
Code comparison
fd:
use fd::FdBuilder;
let results = FdBuilder::new()
.hidden(true)
.ignore_case(true)
.exec("find")
.unwrap();
ueberzug:
import ueberzug.lib.v0 as ueberzug
with ueberzug.Canvas() as c:
demo = c.create_placement('demo')
demo.path = '/path/to/image.png'
demo.x = 0
demo.y = 0
Summary
fd is a fast and user-friendly alternative to the traditional find
command, focusing on file and directory searches with improved performance. ueberzug, on the other hand, is a Python library for displaying images in terminal emulators, offering image rendering capabilities. While fd excels in file searching tasks, ueberzug provides unique functionality for image handling in terminal environments. The choice between the two depends on the specific requirements of the project, whether it's efficient file searching or image manipulation in the terminal.
:cherry_blossom: A command-line fuzzy finder
Pros of fzf
- Broader functionality as a general-purpose fuzzy finder
- Extensive language support and integration with various tools
- Highly customizable with a rich set of options and configurations
Cons of fzf
- Lacks built-in image preview capabilities
- May require additional setup for advanced features
- Primarily focused on text-based searching and filtering
Code Comparison
fzf (command-line usage):
find * -type f | fzf > selected
ueberzug (Python script):
import ueberzug.lib.v0 as ueberzug
with ueberzug.Canvas() as c:
demo = c.create_placement('demo')
demo.path = '/path/to/image.jpg'
demo.visibility = True
Summary
fzf is a versatile fuzzy finder that excels in text-based searching and filtering across various contexts. It offers extensive customization options and integrates well with many tools and languages. However, it lacks native image preview capabilities.
ueberzug, on the other hand, is specifically designed for image previews in terminal emulators. It provides a simple way to display images within the terminal, which can be particularly useful for file managers and image-related workflows.
While fzf focuses on text-based searching and filtering, ueberzug specializes in enhancing terminal applications with image preview functionality. The choice between the two depends on the specific requirements of your project or workflow.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
:warning: seebye/ueberzug is not maintained
First of all: I decided not to work on this project anymore.
ueberzug was a tool which allowed to hack image support into terminal emulators if they fulfilled certain properties.
So it was not made to compete with projects which try to establish a standard for images in terminals like SIXEL, kittys image protocol or similar,
but more it was thought to help during the time in which these protocols are supported to rarely.
It will stop working at the latest if you are forced to switch to wayland.
Such an tool may also increase the adoption time of these image protocols which is why I suggest not to fork this project,
but to move to one of the terminal emulators which have image support.
E.g. SIXEL is already supported by the following terminal emulators:
foot, konsole, wezterm, xterm, Yakuake, Zellij and so on (Source: https://www.arewesixelyet.com/).
If you decide to fork the project none the less it would be nice from you to change or remove the author name in all files.
Top Related Projects
Cross-platform, fast, feature-rich, GPU based terminal
A VIM-inspired filemanager for the console
🖼️ A command-line system information tool written in bash 3.2+
ripgrep recursively searches directories for a regex pattern while respecting your gitignore
A simple, fast and user-friendly alternative to 'find'
:cherry_blossom: A command-line fuzzy finder
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot