G
G
Glory2021-02-12 23:48:11
ImageMagick
Glory, 2021-02-12 23:48:11

Why did the latter take more kilobytes after converting jpg to webp?

Installed Imagemagic and rebuilt it on a Debian server.
I started converting to webp in php using Intervention and noticed that if the source file is jpg, then the file in webp format weighs more than the original. This is if I convert without loss of quality.
If I do a resize, then webp generally weighs very little. The smaller the thumbnail size, the bigger the gap in favor of webp. But if you convert 1 to 1, then webp weighs more than the source.

What could it be?

If we are talking about png, then png weighs more than the result of the conversion.

built imagemagic using

sudo apt-get install libwebp-dev
Then it was a case of rebuilding ImageMagick.

cd /tmp
mkdir imagemagick
cd imagemagick
sudo apt-get build-dep imagemagick
sudo apt-get install libwebp-dev devscripts
sudo apt-get install graphicsmagick-imagemagick-compat
apt-get source imagemagick
cd imagemagick-*
debuild -uc -us
sudo dpkg -i ../*magick *.deb

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
OnYourLips, 2017-09-18
@OnYourLips

It all depends on where you want to use them.
In services? Define it in the service manifest.
In a shell? Define it in your shell settings.
There will be no universal answer.

C
CityCat4, 2017-09-19
@CityCat4

man bash is basically to help you. There, generally speaking, everything is described in sufficient detail, how variables are initialized, in what order the configuration files are read. Man this is quite healthy, but if you read it, much becomes clear.
The first one reads and starts /etc/profile (for a login shell - the one that is registered in passwd or called with the login shell key) The
second one (the first for a non- login shell) - reads and starts /etc/bashrc (or /etc/bash /bashrc)
Third (for login shell) - reads and starts ~/.bash_profile
Fourth (second for non- login shell) - reads and starts ~/.bashrc
This order is extremely important - scripts that start only with login shell actually start oneonce per session, but scripts that start without a login shell - every time. The second thing that is extremely important to understand is that the modification of environment variables is valid only until the exit from the shell in which it was made, unless the value of the variable was passed "up" by the export command. bash_profile usually uses export to pass the generated environment to all programs in the user's session.
Here you can use variables - just like in a regular bash script. For example:

XDG_DATA_DIRS="$tdehome/share:$tderoot/share:/usr/share"; export XDG_DATA_DIRS
XDG_CONFIG_DIRS="/etc/xdg:$tdehome/share/config:$tderoot/share/config"; export XDG_CONFIG_DIRS
XDG_DATA_HOME="$tdehome/share"; export XDG_DATA_HOME
XDG_CONFIG_HOME="$tdehome/share/config"; export XDG_CONFIG_HOME
XDG_CACHE_HOME="$tdehome/spool/tdecache-$USER"; export XDG_CACHE_HOME
XCURSOR_PATH="$tdehome/share/cursors:/usr/share/icons"; export XCURSOR_PATH
XDG_RUNTIME_DIR="/run/user/${uid:q}"; export XDG_RUNTIME_DIR

(a piece of quite real .bash.profile)
man zsh
If you want to stay in Linux for a long time and seriously - the first thing you need to unlearn is to look for a utility "like in Windows". It's long, difficult, I've gotten myself into this more than once - but it's necessary, because many things "like in Windows" are not there, not because it's difficult to do - but because no one needs

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question