I implemented application which perform the following:
- reads JPEG image file as input;
- performs decoding JPEG image;
- performs encoding of decoder’s output data to the JPEG format;
- stores encoded JPEG image to the file.
You will need to install libJPEG first.
sudo apt install libjpeg-dev
Also you need to install Intel TBB library for parallelism.
Donwload this repository and run make file. It generates two console programs: invert
and compress
.
compress
-- console program with minimal interface, which reads JPEG file, decodes JPEG image, compress with given number of quality and stores JPEG image to the file.
invert
-- console program with minimal interface, which reads JPEG file, decodes JPEG image, inverts image pixels, compress with given number of quality and stores JPEG image to the file.
- invert [name of original jpeg file] [name of output jpeg file] [quality number - int]
- compress [name of original jpeg file] [name of output jpeg file] [quality number - int]
- NOTE: you need to specify all parameters correct
Examples:
invert cars.jpeg invertCars.jpeg 34
compress cars.jpeg comprCars.jpeg 24
Original image | Inverted image |
---|---|
27.12.2018:
- now class
Image
uses one single vector instead of vector of vectors for bit map image; parallelInvert()
method was added in the class Image. It does the same asinvert()
, only twice (1.5-2.0 times) as fast on average. This result is achieved through the use TBB library functions and template classes. (full description will be added)- some exceptions are handled (full description will be added later)
- other (full description will be added later)
25.01.2019:
stdInvert()
was added, that uses std::threads for multithreading.
- Write Google Tests
- Handle exceptions
- Update ReadMe
- apodeline.free.fr/DOC/libjpeg - Using the IJG JPEG library
- jpegclub.org/reference - Independent JPEG Group Reference Site
- src/libjpeg.doc - USING THE IJG JPEG LIBRARY
- https://www.threadingbuildingblocks.org/docs/ - Threading Building Blocks (TBB)
- https://software.intel.com/en-us/get-started-with-tbb - Getting Started with Intel® Threading Building Blocks (Intel® TBB)