Skip to content

Commit

Permalink
color model refinements
Browse files Browse the repository at this point in the history
improvements to visual masking
  • Loading branch information
jyrkialakuijala committed Oct 17, 2016
1 parent 2f8d6a0 commit 037eff7
Show file tree
Hide file tree
Showing 15 changed files with 2,855 additions and 1,630 deletions.
24 changes: 24 additions & 0 deletions BUILD
@@ -0,0 +1,24 @@
cc_library(
name = "butteraugli_lib",
srcs = [
"butteraugli/butteraugli.cc",
"butteraugli/butteraugli.h",
],
hdrs = [
"butteraugli/butteraugli.h",
],
copts = ["-Wno-sign-compare"],
visibility = ["//visibility:public"],
)

cc_binary(
name = "butteraugli",
srcs = ["butteraugli/butteraugli_main.cc"],
copts = ["-Wno-sign-compare"],
visibility = ["//visibility:public"],
deps = [
":butteraugli_lib",
"@jpeg_archive//:jpeg",
"@png_archive//:png",
],
)
Empty file modified LICENSE 100644 → 100755
Empty file.
72 changes: 52 additions & 20 deletions README.md 100644 → 100755
@@ -1,27 +1,27 @@
# Butteraugli — a tool for measuring differences between images
# butteraugli

> A tool for measuring perceived differences between images
## Introduction

Butteraugli is a project that estimates the psychovisual similarity of two
images. It gives a score for the images that is reliable in the domain of
barely noticeable differences. Butteraugli not only gives a scalar score,
but also a spatial map of the level of differences.
images. It gives a score for the images that is reliable in the domain of barely
noticeable differences. Butteraugli not only gives a scalar score, but also
computes a spatial map of the level of differences.

One of the main motivations for this project is the statistical differences
in location and density of different color receptors, particularly the
low density of blue cones in the fovea. Another motivation comes from
more accurate modeling of ganglion cells, particularly the frequency
space inhibition.
One of the main motivations for this project is the statistical differences in
location and density of different color receptors, particularly the low density
of blue cones in the fovea. Another motivation comes from more accurate modeling
of ganglion cells, particularly the frequency space inhibition.

## Use

Butteraugli can work as a quality metric for lossy image and
video compression. On our small test corpus butteraugli performs
better than our implementations of the reference methods, psnrhsv-m,
ssim, and our yuv-color-space variant of ssim. One possible use is to
define the quality level setting used in a jpeg compression, or to
compare two or more compression methods at the same level of psychovisual
differences.
Butteraugli can work as a quality metric for lossy image and video compression.
On our small test corpus butteraugli performs better than our implementations of
the reference methods, psnrhsv-m, ssim, and our yuv-color-space variant of ssim.
One possible use is to define the quality level setting used in a jpeg
compressor, or to compare two or more compression methods at the same level of
psychovisual differences.

Butteraugli is intended to be a research tool more than a practical tool for
choosing compression formats. We don't know how well butteraugli performs with
Expand All @@ -30,7 +30,39 @@ roughly corresponding to jpeg qualities 90 to 95.

## Interface

Only a C++ interface is provided. The interface takes two images, gives out a
map and a scalar value defining the difference. The scalar value can be
compared to two reference values that divide the value space into three
experience classes: 'great', 'acceptable' and 'not acceptable'.
Only a C++ interface is provided. The interface takes two images and outputs a
map together with a scalar value defining the difference. The scalar value can
be compared to two reference values that divide the value space into three
experience classes: 'great', 'acceptable' and 'not acceptable'.

## Build instructions

Install [Bazel](http://bazel.io) by following the
[instructions](https://www.bazel.io/docs/install.html). Run `bazel build -c opt
//:butteraugli` in the directory that contains this README file to build the
[command-line utility](#cmdline-tool). If you want to use Butteraugli as a
library, depend on the `//:butteraugli_lib` target.

Alternatively, you can use the Makefile provided in the `butteraugli` directory,
after ensuring that [libpng](http://www.libpng.org/) and
[libjpeg](http://ijg.org/) are installed. On some systems you might need to also
install corresponding `-dev` packages.

The code is portable and also compiles on Windows after defining
`_CRT_SECURE_NO_WARNINGS` in the project settings.

## Command-line utility {#cmdline-tool}

Butteraugli, apart from the library, comes bundled with a comparison tool. The
comparison tool supports PNG and JPG images as inputs. To compare images, run:

```
butteraugli image1.{png|jpg} image2.{png|jpg}
```

The tool can also produce a heatmap of differences between images. The heatmap
will be output as a PNM image. To produce one, run:

```
butteraugli image1.{png|jpg} image2.{png|jpg} heatmap.pnm
```
25 changes: 25 additions & 0 deletions WORKSPACE
@@ -0,0 +1,25 @@
workspace(name = "butteraugli")

new_http_archive(
name = "png_archive",
url = "http://github.com/glennrp/libpng/archive/v1.2.53.zip",
sha256 = "c35bcc6387495ee6e757507a68ba036d38ad05b415c2553b3debe2a57647a692",
strip_prefix = "libpng-1.2.53",
build_file = "png.BUILD",
)

new_http_archive(
name = "zlib_archive",
url = "http://zlib.net/zlib-1.2.8.tar.gz",
sha256 = "36658cb768a54c1d4dec43c3116c27ed893e88b02ecfcb44f2166f9c0b7f2a0d",
strip_prefix = "zlib-1.2.8",
build_file = "zlib.BUILD",
)

new_http_archive(
name = "jpeg_archive",
url = "http://www.ijg.org/files/jpegsrc.v9a.tar.gz",
sha256 = "3a753ea48d917945dd54a2d97de388aa06ca2eb1066cbfdc6652036349fe05a7",
strip_prefix = "jpeg-9a",
build_file = "jpeg.BUILD",
)
7 changes: 7 additions & 0 deletions butteraugli/Makefile
@@ -0,0 +1,7 @@
LDLIBS += -lpng -ljpeg
CXXFLAGS += -std=c++11 -I..
LINK.o = $(LINK.cc)

all: butteraugli.o butteraugli_main.o butteraugli

butteraugli: butteraugli.o butteraugli_main.o

0 comments on commit 037eff7

Please sign in to comment.