MyNixOS website logo
Description

Image Statistics Based on Processing Fluency.

Get image statistics based on processing fluency theory. The functions provide scores for several basic aesthetic principles that facilitate fluent cognitive processing of images: contrast, complexity / simplicity, self-similarity, symmetry, and typicality. See Mayer & Landwehr (2018) <doi:10.1037/aca0000187> and Mayer & Landwehr (2018) <doi:10.31219/osf.io/gtbhw> for the theoretical background of the methods.

imagefluency: Image Statistics Based on Processing Fluency

Overview

imagefluency is a simple R package for image fluency scores. The package allows to get scores for several basic aesthetic principles that facilitate fluent cognitive processing of images.

The main functions are:

  • img_contrast() to get the visual contrast of an image.
  • img_complexity() to get the visual complexity of an image (equals 1 minus image simplicity)
  • img_self_similarity() to get the visual self-similarity of an image
  • img_simplicity() function to get the visual simplicity of an image (equals 1 minus image complexity).
  • img_symmetry() to get the vertical and horizontal symmetry of an image.
  • img_typicality() to get the visual typicality of a list of images relative to each other

Other helpful functions are:

  • img_read() wrapper function to read images into R using read.bitmap() from the readbitmap package
  • rgb2gray() convert images from RGB into grayscale (might speed up computation)
  • run_imagefluency() to launch a Shiny app locally on your computer for an interactive demo of the main functions

The main author is Stefan Mayer.

Installation

You can install the current stable version from CRAN.

install.packages('imagefluency')

To download the latest development version from Github use the install_github function of the remotes package.

# install remotes if necessary
if (!require('remotes')) install.packages('remotes')
# install imagefluency from github
remotes::install_github('stm/imagefluency')

Optionally, if you have rmarkdown installed, you can also have your system build the the vignettes when downloading from GitHub.

# install from github with vignettes (needs rmarkdown installed)
remotes::install_github('stm/imagefluency', build_vignettes = TRUE)

Use the following link to report bugs/issues: https://github.com/stm/imagefluency/issues

Example usage

# visual contrast
#
# example image file (from package): bike.jpg
bike_location <- system.file('example_images', 'bike.jpg', package = 'imagefluency')
# read image from file
bike <- img_read(bike_location)
# get contrast
img_contrast(bike)

# visual symmetry
#
# read image
rails <- img_read(system.file('example_images', 'rails.jpg', package = 'imagefluency'))
# get only vertical symmetry
img_symmetry(rails, horizontal = FALSE)

Documentation

See the getting started vignette for a detailed introduction and the reference page for details on each function.

If you are analyzing a larger number of images, make sure to read the tutorial on how to analyze multiple images at once.

Citation

To cite imagefluency in publications use:

Mayer, S. (2024). imagefluency: Image Statistics Based on Processing Fluency. R package version 0.2.5. doi: 10.5281/zenodo.5614665

A BibTeX entry is:

@software{,
  author       = {Stefan Mayer},
  title        = {imagefluency: Image Statistics Based on Processing Fluency},
  year         = 2024,
  version      = {0.2.5},
  doi          = {10.5281/zenodo.5614665},
  url          = {https://imagefluency.com}
}

Dependencies

The img_complexity function relies on the packages R.utils and magick. The img_self_similarity function relies on the packages OpenImageR, pracma, and quadprog. The img_read function relies on the readbitmap package. The run_imagefluency shiny app depends on shiny.

Further references

To learn more about the different image fluency metrics, see the following publications:

  • Mayer, S. & Landwehr, J, R. (2018). Quantifying Visual Aesthetics Based on Processing Fluency Theory: Four Algorithmic Measures for Antecedents of Aesthetic Preferences. Psychology of Aesthetics, Creativity, and the Arts, 12(4), 399--431. doi: 10.1037/aca0000187

  • Mayer, S. & Landwehr, J. R. (2018). Objective measures of design typicality. Design Studies, 54, 146--161. doi: 10.1016/j.destud.2017.09.004

Code of Conduct

Please note that this project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

Metadata

Version

0.2.5

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows