Coder Social home page Coder Social logo

imageprocessing-electronicpublications / libjpegqs Goto Github PK

View Code? Open in Web Editor NEW
8.0 3.0 2.0 145 KB

Library JPEG Quant Smooth

Home Page: https://github.com/ilyakurdyukov/jpeg-quantsmooth

License: GNU Lesser General Public License v2.1

Makefile 2.06% C 97.94%
image jpeg dct simd library unjpeg

libjpegqs's Introduction

GitHub release (latest by date) GitHub Release Date GitHub repo size GitHub all releases GitHub

Library JPEG Quant Smooth

This program tries to recreate lost precision of DCT coefficients based on quantization table from jpeg image. Output saved as jpeg image with quantization set to 1 (like jpeg saved with 100% quality). You can save smoothed image with original quantization tables resulting in same DCT coefficients as in original image.

You may not notice jpeg artifacts on the screen without zooming in, but you may notice them after printing. Also, when editing compressed images, artifacts can accumulate, but if you use this program before editing - the result will be better.

WebAssembly

Web version available here. Runs in your browser, none of your data is send outside. But without multithreading and SIMD optimizations it works noticeably slower.

Usage

jpegqs [options] input.jpg output.jpg

Options

--optimize Smaller output file.

--verbose n Print debug info form libjpeg.

--info n Print debug info from quantsmooth (on by default, set to 0 to disable).

--border N.N Size border (default = 2.0)

--gain N.N Gain coefficients (default = 2.0)

--scale N.N Scale delta coefficients (default = 1.0)

--niter N Number iteration (default = 3)

Examples

Note: Images 3x zoomed.

Original images:

JPEG with quality increasing from 8% to 98%:

After processing:

Buliding on Linux

If you have "libjpeg-dev" package installed, just type:

make

Tested with packages from Ubuntu-18.04, and from sources: libjpeg (6b), libjpeg-turbo (1.4.2, 1.5.3, 2.0.4).

If you do not want to use SSE, type:

make CFLAGS="-fopenmp -O2 -mno-sse2"

If you do not want to use OPENMP (MacOS), type:

make MPFLAGS=

Or when using libomp (MacOS):

make MPFLAGS="-Xpreprocessor -fopenmp -lomp"

With libjpeg 6b form sources

wget https://www.ijg.org/files/jpegsrc.v6b.tar.gz
tar -xvzf jpegsrc.v6b.tar.gz
(cd jpeg-6b && ./configure && make all)
make LIBS="-I jpeg-6b jpeg-6b/libjpeg.a -lm"

Building on Windows

Get MSYS2, install needed packages with pacman and build with release.sh. If you not familiar with building unix applications on windows, then you can download program from releases.

Alternatives and comparison

Similar projects, and how I see them after some testing.

jpeg2png:
 ✔️ good documentation and math model
 ✔️ has tuning options
 ✔️ better at deblocking low quality JPEG images
 ❓ little blurry in default mode (compared to quantsmooth), but can be tuned
 ➖ 10 to 20 times slower
 ➖ less permissive license (GPL-3.0)

jpeg2png can provide roughly same quality (better in not common cases), but significantly slower.

knusperli:
 ✔️ more permissive license (Apache-2.0)
 ➖ you can hardly see any improvements on the image
 ➖ no performance optimizations (but roughly same speed as for quantsmooth with optimizations)
 ➖ no any command line options
 ➖ uncommon build system

knusperli is good for nothing, in my opinion.

Base project page

https://github.com/ilyakurdyukov/jpeg-quantsmooth

Project page

https://github.com/ImageProcessing-ElectronicPublications/libjpegqs

2020

libjpegqs's People

Contributors

zvezdochiot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

libjpegqs's Issues

The chroma upscaling code is missing.

Since the time that you forked my repository - I have added chroma upscaling code to better match jpeg2png, which also has such a feature. And I implemented it myself, but in a different way.

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.