Vignette is a Python library to create and manage thumbnails following the FreeDesktop standard.

Overview

Vignette

Vignette is a Python library to create and manage thumbnails following the FreeDesktop standard.

Thumbnails are stored in a shared directory so other apps following the standard can reuse them without having to generate their own thumbnails.

Vignette can typically be used in file managers, image browsers, etc.

Thumbnails are not limited to image files on disk but can be generated for other file types, for example videos or documents but also for any URL, for example a web browser could store thumbnails for recently visited pages or bookmarks.

Vignette by itself can only generate thumbnails for local files but can retrieve thumbnail for any file or URL, if another app generated a thumbnail for it. An app can also generate a thumbnail by its own means and use vignette to push that thumbnail to the store.

The range of files for which vignette can generate thumbnails depends on plugins as it supports third-party libraries and tools. For example, if the evince-thumbnailer command is installed, it will be able to generate thumbnails for PDF files.

Install

From PyPI:

pip install vignette

Documentation

The documentation can be read online.

This library has querying functions, that do not generate thumbnails, and can be used with files or URLs, that can be non-images:

  • build_thumbnail_path
  • try_get_thumbnail
  • is_thumbnail_failed

It has functions that have side effects, which write thumbnails, or "fail-files" (if a thumbnail couldn't be generated), they can require local-files (see the function's doc):

  • get_thumbnail
  • create_thumbnail
  • put_thumbnail
  • put_fail

Examples

Just ask for thumbnails of local images, automatically creating them if necessary:

import vignette

thumb_image = vignette.get_thumbnail('/my/file.jpg')
local_app_display(thumb_image)

Ask for a thumbnail or generate it manually, for example a web-browser generating pages previews, that this module can't do itself:

import vignette

orig_url = 'http://example.com/file.pdf'
thumb_image = vignette.try_get_thumbnail(orig_url, mtime=0) # mtime is not used in this example

if not thumb_image:
  thumb_image = vignette.build_thumbnail_path(orig_url, 'large')
  try:
    local_app_make_preview(orig_url, thumb_image)
  except NetworkError:
    vignette.put_fail(orig_url, 'mybrowser-1.0', mtime=0)
  else:
    thumb_image = vignette.put_thumbnail(orig_url, 'large', mtime=0)
  if is_thumbnail_failed(orig_url):
    thumb_image = 'error.png'

local_app_display(thumb_image)

Requirements

Vignette works with both Python 2 and Python 3.

Vignette requires at least one image backend to work properly. See the backends section below.

Backends

Vignette does not contain image format code. In order to generate a thumbnail from an image or update metadata as required by the Freedestkop standard, vignette uses external libraries. The dependencies are "lazy" though: if an external library is missing, vignette ignores it and falls back on other equivalent libs.

Backends are divided in 2 types:

  • thumbnail backends, which create a thumbnail image from a source image file, a source video file, or another input URL
  • metadata backends, which are used internally in vignette to manage the metadata of thumbnails

Vignette currently has thumbnail/metadata backends supporting:

  • Python Imaging Library (PIL)
  • PyQt
  • PythonMagick

One of these libraries is required for vignette to work in basic cases (thumbnailing local images).

Vignette has additional thumbnail backends to support these tools:

If a lib is not present, vignette continues to operate but thumbnails for certain file formats may not be generated.

License

Vignette is licensed under the WTFPLv2.

Version

Vignette is currently at version 5.0.0 and uses Semantic Versioning.

Owner
If you like free software, go to https://gitlab.com/hydrargyrum instead
kikuchipy is an open-source Python library for processing and analysis of electron backscatter diffraction (EBSD) patterns

kikuchipy is an open-source Python library for processing and analysis of electron backscatter diffraction (EBSD) patterns. The library builds on the

pyxem 53 Dec 29, 2022
QR-code Generator with a basic GUI.

Qr_generator_python Qr code generator with a basic GUI. ❔ About the QR-Code-Generator This project Generates QR codes to sites, e-mails and plain text

Tecixck 2 Oct 11, 2021
Tools for making image cutouts from sets of TESS full frame images

Cutout tools for astronomical images Astrocut provides tools for making cutouts from sets of astronomical images with shared footprints. It is under a

Space Telescope Science Institute 20 Dec 16, 2022
Validate arbitrary image uploads from incoming data urls while preserving file integrity but removing EXIF and unwanted artifacts and RCE exploit potential

Validate arbitrary base64-encoded image uploads as incoming data urls while preserving image integrity but removing EXIF and unwanted artifacts and mitigating RCE-exploit potential.

A3R0 1 Jan 10, 2022
GPU-accelerated image processing using cupy and CUDA

napari-cupy-image-processing GPU-accelerated image processing using cupy and CUDA This napari plugin was generated with Cookiecutter using with @napar

Robert Haase 16 Oct 26, 2022
Advance Image Steganography

Chaya Advance Image Steganography Using LSB-LPS + AES-256-GCM + FLIF Right To Privacy! United Nations Declaration of Human Rights (UDHR) 1948, Article

XeroHack 113 Dec 02, 2022
Avatar Generator Python

This is a simple avatar generator project which uses your webcam to take pictures and saves five different types of your images into your device including the original image.

Faisal Ahmed 3 Jan 23, 2022
A collection of python scripts which help you programatically create PNGs or GIFs

A collection of python scripts which help you programatically create PNGs or GIFs and their Metadata in bulk with custom rarity rates, upload them to OpenSea & list them for sale.

Tom 30 Dec 24, 2022
Javascript image annotation tool based on image segmentation.

JS Segment Annotator Javascript image annotation tool based on image segmentation. Label image regions with mouse. Written in vanilla Javascript, with

Kota Yamaguchi 513 Nov 15, 2022
a lite weight photo editor written in python for day to day photo editing!

GNU-PhotoShop A lite weight Photo editing Program (currently CLI only) written in python3 for day to day photo editing. Disclaimer : Currently we don'

Kunal Sharma 5 May 30, 2022
Pythonocc nodes for Ryven

Pythonocc-nodes-for-Ryven Pythonocc nodes for Ryven Here a way to work on Pythonocc with a node editor, Ryven in that case. To get it functional you w

Tanneguy 30 Dec 18, 2022
Image histogram remapping

Hmap An image histogram remapping script written in Python 2.7 by Anthony Kesich and Ross Goodwin. Changes source image so that source image's histogr

Ross Goodwin 199 Nov 19, 2022
Image enhancing model for making a blurred image to be somehow clearer than before

This is a very small prject which helps in enhancing the images by taking a Input images. This project has many features like detcting the faces and enhaning the faces itself and also a feature which

3 Dec 03, 2021
A Robust Avatar Generator with a huge number of templates

CoolAvatars Welcome to this repository of CoolAvatars. Using this project, you can generate cool avatars not only from the samples present in my image

RAVI PRAKASH 5 Oct 12, 2021
3D printer / slicing GUI built on top of the Uranium framework

Cura Ultimaker Cura is a state-of-the-art slicer application to prepare your 3D models for printing with a 3D printer. With hundreds of settings and h

Ultimaker 4.4k Jan 02, 2023
Herramienta Para Snipear Nitros Y Participar En Sorteos Automaticamente

Crips Nitro Sniper Discord Nitro Sniper Y Auto Participar En Sorteos ⚠️ Es Bastante Rapido Y Efectivo Hecho En Python Como Usar ( Python ) : python -m

1 Oct 27, 2021
Gallery written in Python to manage your photos

GalleryMan Gallery written in Python to manage your photos Installation

Asian Cat 24 Dec 18, 2022
Next-generation of the non-destructive, node-based 2D image graphics editor

Non-destructive, node-based 2D image graphics editor written in Python, focused on simplicity, speed, elegance, and usability

Gimel Studio 238 Dec 30, 2022
An agnostic Canvas API for the browser-less and insane

Apollo An agnostic Canvas API for the browser-less and mildly insane. Project Apollo is a Pythonic re-imagining of HTML Canvas element implementati

1 Jan 13, 2022
Generate meme GIFs in which an image you choose can be viewed by the user only after they wait a whole hour.

Generate meme GIFs in which an image you choose can be viewed by the user only after they wait a whole hour.

Feliks Maak 1 Jan 31, 2022