Feb. 7th, 2020

henry_flower: A melancholy wolf (Default)
$ du *jpg | sort -r
784K    orig.jpg
526K    jpeg-recompress.jpg
316K    imgmin.jpg

Не розумію, чому раніше не користувався.

  • jpeg-recompress: Compress JPEGs by re-encoding to the smallest JPEG quality while keeping perceived visual quality the same and by making sure huffman tables are optimized.

  • imgmin: generate versions of an image at multiple different quality settings, and find the version with the mean pixel error rate nearest to but not exceeding 1.0. Using quality bounds of [95, 50] we perform a binary search of the quality space, converging on the lowest quality setting that produces a mean pixel error rate of < 1.0.

Останнє компілюється без проблем на федорі, а для 1го прийшлося окремо писати rpm spec. Релевантний шматок з (спочатку компілюємо mozjpeg, потім підказуємо jpeg-archive де його шукати; фінальні jpeg-archive байнаріс mozjpeg не вимагають):

%prep
rm -rf mozjpeg-%commit1 mozjpeg mozjpeg-build
tar xfz $RPM_SOURCE_DIR/mozjpeg-%shortcommit1.tar.gz
mkdir mozjpeg-build && cd mozjpeg-build
cmake -G"Unix Makefiles" -DWITH_JPEG8=1 -DPNG_SUPPORTED=0 \
      -DCMAKE_INSTALL_PREFIX=$RPM_BUILD_DIR/mozjpeg ../mozjpeg-%commit1
make install

cd $RPM_BUILD_DIR
rm -rf %name-%commit0
tar xfz $RPM_SOURCE_DIR/%name-%shortcommit0.tar.gz

%build
cd $RPM_BUILD_DIR/%name-%commit0
%make_build MOZJPEG_PREFIX=$RPM_BUILD_DIR/mozjpeg

Для порівняння (оригінальне фото є розміром 2048x1536):

Read more... )

Page Summary

June 2025

M T W T F S S
      1
2345678
91011 12131415
16171819202122
23242526272829
30      

Expand Cut Tags

No cut tags