Skip to main content

VisFeats: Extraction of Global Visual Features from Images

Ruff Python Version

VisFeats is a library for extracting global visual features from images.

Installation

VisFeats is installable via PyPI:

pip install visfeats

Or via GitHub (for the latest development version):

pip install git+https://github.com/ncc-brain/VisFeats.git

Usage

To use VisFeats, first load an image using PIL:

from PIL import Image
image = Image.open("path/to/your/image.jpg")

All functions in VisFeats take a PIL Image.Image as input and return the corresponding feature values. Available features are described below.

Extract multiple features

Use extract_all_features to collect all package-level features, or pass a feature name or list of names to select a subset. The result is a flat dictionary.

from visfeats import extract_all_features
features = extract_all_features(image, features=["rms", "hsv_features"])

Mean and entropy of HSV channels

Chromatic features describe color in HSV (Hue, Saturation, Value) space, including channel means and entropies. The hsv_features function returns a dictionary with six keys:

  • hue_mean
  • saturation_mean
  • value_mean
  • hue_entropy
  • saturation_entropy
  • value_entropy
from visfeats import hsv_features
features = hsv_features(image)

Spatial frequency features

Spatial frequency features capture the distribution of different spatial frequencies in an image, which relate to the level of detail and texture. The spatial_frequency_features function extracts these features:

  • fourier_slope
  • fourier_deviation
  • dimensionality
  • spectral_centroid
  • spectral_variance
from visfeats import spatial_frequency_features
features = spatial_frequency_features(image)

Memorability

While memorability is often considered a subjective property, recent research has shown that it can be predicted from image content. Here the memorability_resmem function estimates intrinsic memorability using the pretrained ResMem model described by Needell and Bainbridge (2022).

ResMem is an optional dependency. It can be installed along with VisFeats using:

pip install "visfeats[resmem]"

Or separately with:

pip install resmem

Then you can use the memorability_resmem function to estimate the memorability of an image:

from visfeats import memorability_resmem
resmem_score = memorability_resmem(image)

Other features

RMS contrast

The rms function computes the root-mean-square contrast as the population standard deviation of the image's grayscale pixel intensities.

from visfeats import rms
rms_contrast = rms(image)

Compressibility

The compressibility_pillow function estimates how compressible an image is as the negative encoded size in bits per pixel, using lossless PNG encoding in memory by default. Values closer to 0 indicate a more compressible image.

from visfeats import compressibility_pillow
compressibility = compressibility_pillow(image)

Metadata

Release files for visfeats 0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for visfeats 0.2
File Size Uploaded
visfeats-0.2.tar.gz 18.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for visfeats 0.2
File Interpreter ABI Platform
visfeats-0.2-py3-none-any.whl Python 3 none any Details

Total release size: 31.2 kB

Release files / visfeats-0.2.tar.gz

Download URL visfeats-0.2.tar.gz
Size 18.5 kB
Tags Source
SHA-256 checksum
How to use checksums
7eb8bb6a14f3b028ec5e043db5cc0ae1c13bd850d55ea8195eb1a605001c6afb
BLAKE2b-256 checksum
How to use checksums
75cb1cb65bc85c22815545f605a2cb1f7759a330243f366c798bd946476321c8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 11, 2026.

Transparency log

Release files / visfeats-0.2-py3-none-any.whl

Download URL visfeats-0.2-py3-none-any.whl
Size 12.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e0a87fd920b09f22fecf1b0d64f731ab59294c8194e0ec67eac41091f00e6b6f
BLAKE2b-256 checksum
How to use checksums
c4783e4d37aef43c8aaadea76d46ccc6afd2bb5891603c6fd5dc52652ac17b5f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 11, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2 This release

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page