grassleaff/sVisualizer
1
0
Fork
You've already forked sVisualizer
0
A SDL2 lightweight and simple image visualizer written in C
  • C 80.5%
  • Makefile 19.5%
Find a file
2026年05月20日 10:05:19 -03:00
assets ADD: New sv.png 2026年03月27日 10:33:55 -03:00
desktop A lot of things added, gg 2025年07月15日 20:53:26 -03:00
.gitignore Modifying .gitignore 2025年09月30日 00:17:32 -03:00
config.h ADD/FIX: New smooth scaling with linear filtering for medium/high resolution images + fix mouse scroll offset 2026年05月20日 10:05:19 -03:00
LICENSE Add GNU GPL2 License, a Makefile and more to main.c 2025年07月15日 19:39:09 -03:00
main.c ADD/FIX: New smooth scaling with linear filtering for medium/high resolution images + fix mouse scroll offset 2026年05月20日 10:05:19 -03:00
Makefile ADD [MAJOR UPDATE]: Add info bar, OS-native file picker and display improvements 2026年03月19日 11:02:38 -03:00
README.md ADD/FIX: New smooth scaling with linear filtering for medium/high resolution images + fix mouse scroll offset 2026年05月20日 10:05:19 -03:00

accessibility text

A lightweight command-line image viewer built with SDL2.

Features

  • Zoom in and out with the keyboard or mouse scroll wheel
  • Zoom follows the mouse cursor position
  • Pan with arrow keys or by clicking and dragging
  • Bottom info bar showing filename, dimensions, format, and zoom level (toggle with t)
  • Fit-to-window mode that automatically scales the image when the window is resized (toggle with w)
  • Fullscreen mode (toggle with f)
  • Native OS file picker dialog when no image path is provided
  • Borderless window
  • Adaptive scaling: nearest-neighbor for very small source images, linear filtering for medium/high resolution images

Supported Formats

Format Notes
JPEG Requires libjpeg
PNG Requires libpng
GIF Built-in (static, first frame only)
TIFF Requires libtiff
WEBP Requires libwebp
BMP, ICO, XPM, PCX, PNM Built-in

Controls

Input Action
+ / = Zoom in
- Zoom out
Scroll wheel Zoom in/out (centered on cursor)
Arrow keys Pan
Left click + drag Pan
r Reset view
w Toggle fit-to-window
f Toggle fullscreen
t Toggle info bar
q Quit

Dependencies

Building

Linux

# Debian/Ubuntu
sudo apt install gcc libsdl2-dev libsdl2-image-dev libsdl2-ttf-dev
# Arch
sudo pacman -S gcc sdl2 sdl2_image sdl2_ttf
# Fedora
sudo dnf install gcc SDL2-devel SDL2_image-devel SDL2_ttf-devel
make

macOS

brew install sdl2 sdl2_image sdl2_ttf
make

Windows (MSYS2)

pacman -S mingw-w64-x86_64-gcc \
 mingw-w64-x86_64-SDL2 \
 mingw-w64-x86_64-SDL2_image \
 mingw-w64-x86_64-SDL2_ttf
make

To generate a self-contained folder with the binary and all required DLLs:

make bundle

Installation

sudo make install # installs to /usr/local/bin
sudo make uninstall

Supports DESTDIR for packaging:

make install DESTDIR=/tmp/pkg PREFIX=/usr

Usage

sv image.png
sv # opens native file picker

Debug Build

make DEBUG=1

License

GNU GPLv2 License — Copyright (c) 2025 grassleaff. All Rights Reserved.