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
A linear stairs generation add-on for Blender

Linear Stairs Generator Table of Contents Installation Usage Screenshots Important Notes Requirements Blender 3.0 or newer. Installation: Download a z

Elhanan Flesch 4 May 17, 2022
Goddard Image Analysis and Navigation Tool

Copyright 2021 United States Government as represented by the Administrator of the National Aeronautics and Space Administration. No copyright is clai

NASA 12 Dec 23, 2022
PyLibTiff - a wrapper to the libtiff library to Python using ctypes

PyLibTiff is a package that provides: a wrapper to the libtiff library to Python using ctypes. a pure Python module for reading and writing TIFF and L

Pearu Peterson 105 Dec 21, 2022
Console images in 48 colors, 216 colors and full rgb

console_images Console images in 48 colors, 216 colors and full rgb Full RGB 216 colors 48 colors If it does not work maybe you should change color_fu

Урядов Алексей 5 Oct 11, 2022
Conversion of Image, video, text into ASCII format

asciju Python package that converts image to ascii Free software: MIT license

Aju Tamang 11 Aug 22, 2022
Kainat 13 Mar 07, 2022
Fast Image Retrieval (FIRe) is an open source image retrieval project

Fast Image Retrieval (FIRe) is an open source image retrieval project release by Center of Image and Signal Processing Lab (CISiP Lab), Universiti Malaya. This project implements most of the major bi

CISiP Lab 39 Nov 25, 2022
Fast Image Retrieval is an open source image retrieval framework

Fast Image Retrieval is an open source image retrieval framework release by Center of Image and Signal Processing Lab (CISiP Lab), Universiti Malaya. This framework implements most of the major binar

CISiP Lab 39 Nov 25, 2022
⚡ZenGL is a minimalist Python module providing exactly one way to render scenes with OpenGL.

ZenGL is a minimalist Python module providing exactly one way to render scenes with OpenGL.

Szabolcs Dombi 133 Dec 17, 2022
An async Python library to automate solving ReCAPTCHA v2 by audio using Playwright.

Playwright nonoCAPTCHA An async Python library to automate solving ReCAPTCHA v2 by audio using Playwright. Disclaimer This project is for educational

Michael Mooney 69 Dec 28, 2022
A tool for hiding data inside of images

Stegenography-tool a tool for hiding data inside of images Quick test: do python steg-encode.py test/message.txt test/covid19.png to generate the test

luke 2 Nov 02, 2021
Manipulate EXIF and IFD metadata.

Tyf Copyright Distribution Support this project Buy Ѧ and: Send Ѧ to AUahWfkfr5J4tYakugRbfow7RWVTK35GPW Vote arky on Ark blockchain and earn Ѧ weekly

16 Jan 21, 2022
Alternate Python bindings for the Open Asset Import Library (ASSIMP)

Impasse A simple Python wrapper for assimp using cffi to access the library. Requires Python = 3.7. It's a fork of PyAssimp, Assimp's official Python

Salad Dais 3 Sep 26, 2022
A procedural Blender pipeline for photorealistic training image generation

BlenderProc2 A procedural Blender pipeline for photorealistic rendering. Documentation | Tutorials | Examples | ArXiv paper | Workshop paper Features

DLR-RM 1.8k Jan 02, 2023
SGTL - Spectral Graph Theory Library

SGTL - Spectral Graph Theory Library SGTL is a python library of spectral graph theory methods. The library is still very new and so there are many fe

Peter Macgregor 6 Oct 01, 2022
An API which would colorize a black and white image

Image Colorization API Machine Learning Model used- https://github.com/richzhang/colorization/tree/caffe Paper - https://arxiv.org/abs/1603.08511 Step

Neelesh Ranjan Jha 4 Nov 23, 2021
Fuzzware is a project for automated, self-configuring fuzzing of firmware images

Fuzzware Fuzzware is a project for automated, self-configuring fuzzing of firmware images. The idea of this project is to configure the memory ranges

190 Dec 21, 2022
Forza painter app with python

forza-painter Discord: A-Dawg#0001 (AE) Supports: Forza Horizon 5 Offically (OTHER v1.405.2.0, MS STORE v3.414.967.0, STEAM v1.414.967.0) Unofficially

320 Dec 31, 2022
LabelMe annotation tool source code

LabelMe annotation tool source code Here you will find the source code to install the LabelMe annotation tool on your server. LabelMe is an annotation

MIT CSAIL Computer Vision 1.3k Jan 03, 2023
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