Git Product home page Git Product logo

knusperli's Introduction

Knusperli

The goal of Knusperli is to reduce blocking artifacts in decoded JPEG images, by interpreting quantized DCT coefficients in the image data as an interval, rather than a fixed value, and choosing the value from that interval that minimizes discontinuities at block boundaries.

a traditional JPEG decoder (Imagemagick 7.0.8-59) Knusperli
baboon JPEG, zoomed baboon Knusperli, zoomed
baboon JPEG baboon Knusperli

Building

Knusperli builds with Bazel:

CC=gcc bazel build :knusperli
bazel-bin/knusperli input.jpg output.png

Details

A JPEG encoder quantizes DCT coefficients by rounding coefficients to the nearest multiple of the elements of the quantization matrix. For every coefficient, there is an interval of values that would round to the same multiple. A traditional decoder uses the center of this interval to reconstruct the image. Knusperli instead chooses the value in the interval that reduces discontinuities at block boundaries. The coefficients that Knusperli uses, would have rounded to the same values that are stored in the JPEG image.

Disclaimer

This is not an officially supported Google product.

knusperli's People

Contributors

jyrkialakuijala avatar lovasoa avatar pames avatar ruuda avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

knusperli's Issues

Use an alternative to Lenna for image samples

The Lenna/Lena image is from a Playboy centrefold. The image compression community has been moving away from its use since the 1990's.

There are plenty of alternative images that you can use to demonstrate deblocking, including some that have been around nearly as long as Lenna, such as Mandrill or Peppers, available here: http://sipi.usc.edu/database/database.php?volume=misc&image=13#top

Note also that SIPI has removed access to Lenna as well as other images of dubious origin.

bazel build fails during evaluating WORKSPACE file

# bazel version
Build label: 0.23.0
Build target: bazel-out/k8-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Tue Feb 26 17:42:16 2019 (1551202936)
Build timestamp: 1551202936
Build timestamp as int: 1551202936

here the actual error-message:

# CC=gcc bazel build :knusperli
ERROR: /home/bastian/software/knusperli/WORKSPACE:1:1: name 'new_git_repository' is not defined
ERROR: Error evaluating WORKSPACE file
ERROR: error loading package '': Encountered error while reading extension file 'tools/build_defs/repo/http.bzl': no such package '@bazel_tools//tools/build_defs/repo': error loading package 'external': Could not load //external package
ERROR: error loading package '': Encountered error while reading extension file 'tools/build_defs/repo/http.bzl': no such package '@bazel_tools//tools/build_defs/repo': error loading package 'external': Could not load //external package
INFO: Elapsed time: 0.142s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)

I did not changed anything, this is a fresh checkout and the WORKSPACE file has newer changed according to git history. What I'am doing wrong?

A few thoughts

I think knusperli does work well but the amount of improvement you get depend on what JPEG encoder you compare it against.I was able to replicate your result with IM 6.9 .However there is a more modern JPEG encoder(by Thomas Richter) you can use that produces better quality JPEG images(less blocky atefacts).

https://github.com/thorfdbg/libjpeg

I compared JPEG decoder from IM and improved libjpeg from Thomas and added them in a zip.

https://drive.google.com/file/d/1jx1XlbI-wb-1EitvXDbA0kMHqlvkEQ7L/view?usp=sharing

Source Image:
https://drive.google.com/file/d/0B0w_eoSgaBLXOU03eXNfc2RSSE0/view?usp=sharing

Unexpected end of input

I wanted to test this so I saved a new JPEG image in MS Paint (this), but I am getting an error when I try to convert this image:

Unexpected end of input: pos=230 need=162 len=273
Error reading jpeg data from input file.

This image is in yuv420p. When I convert the image with ffmpeg to a new JPEG file, it works on it.

Deleting on-topic comments without consent in issue #4

@jyrkialakuijala After saying "Thank you everyone for sharing your views on this topic.", you deleted all on-topic comments that you could. One-sidedly. And I gotta tell you that is a pretty nasty thing to do. You have no right to silence people on an open platform like this one for contributing to a valid discussion.

Link to issue #4 for reference.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.