Skip to content

Latest commit

 

History

History
86 lines (53 loc) · 3.68 KB

iv.md

File metadata and controls

86 lines (53 loc) · 3.68 KB

iv — Wayland HDR image viewer

Screenshot

iv is a Wayland application that can display images. Fractional scaling is properly supported (you can't run without it), along with true HDR output if you have the proper setup. iv does not use any UI toolkits (such as GTK or Qt) to interact with the Wayland compositor. Vulkan 1.4 is required.

Fractional scaling

A lot of care has been taken to make the pictures look the way they should. This may sound silly, but some image viewers are not able to do this. See https://wolf.nereid.pl/posts/image-viewer/#interlude-1 for more details.

High dynamic range

To get HDR working in iv, you may need to install https://github.com/Zamundaaa/VK_hdr_layer and set the ENABLE_HDR_WSI=1 environment variable. If a working HDR pipeline is not available, HDR images will be tone mapped to SDR.

Correct gamma handling

Most image viewers do not handle gamma correction properly. For example, here's a screenshot of a specially crafted image scaled down to 50% in iv on the left and another program on the right. The rectangles on both sides should have the same color, which they do in iv. See http://www.ericbrasseur.org/gamma.html for a detailed explanation of this problem.

Gamma comparison

A more practical example is shown below, where the legibility of scaled-down text depends strongly on the proper handling of the gamma correction. The image on the left is displayed with iv, and the image on the right is displayed with another program that does not handle gamma the right way.

Gamma comparison

Close-up of the images

Images that are zoomed in are displayed using nearest neighbor filtering. This works fine for integer zoom levels (200%, 300%, etc.), but would produce ugly results in other cases where the pixels inevitably don't have the same size, as shown in the screenshot below from another program.

Non-uniform pixels

This is not a problem in iv, where close-ups of images are properly filtered so that each pixel is the same size. Since this results in sub-pixel detail, the displayed image may appear blurry.

Properly filtered pixels

Usage

To load an image in iv you can:

  • Pass it as a command-line parameter,
  • Drag and drop the image on the viewer window,
  • Copy and paste the image.

When you open a single image, its directory will be scanned for other images so that you can switch between them. Providing multiple images with the above actions only allows switching between them.

You can pan the image by holding down the right mouse button. Zoom is done with the mouse wheel. The left mouse button is used to draw a selection rectangle and to change or cancel it.

Keybindings:

  • 1 sets the zoom level to 100%.
  • 2 sets the zoom level to 200%.
  • 3 sets the zoom level to 400%.
  • 4 sets the zoom level to 800%.
  • F makes the image fit in the window (will only scale down).
  • Ctrl+F makes the image fill the window (will also scale up).
  • Shift+F resizes the window to fit the image.
  • F11 enables fullscreen mode.
  • Escape exits the application.
  • ← and → switch between images.
  • Ctrl+C copies the selected region to clipboard (or whole image if no selection).
  • Ctrl+X cuts the selected region to clipboard (fills with black).
  • Ctrl+V pastes an image from the clipboard.
  • Ctrl+S saves the image to a file.
  • H toggles between SDR and HDR mode.

Future plans

  • Load vector images (SVG, PDF).
  • Animation support.