To set the default quality to 100 for the Linux convert command (part of the ImageMagick suite), you have a few options:
100
convert
-quality
You can specify the quality for each command:
convert input.jpg -quality 100 output.jpg
policy.xml
To make 100 the default quality for all convert operations, you can modify ImageMagick's policy configuration file:
Open the policy file (location may vary by distribution):
sudo nano /etc/ImageMagick-6/policy.xml
(Replace 6 with your ImageMagick version if different.)
6
Locate or add the following line inside the <policymap> section:
<policymap>
<policy domain="coder" name="quality" value="100"/>
Save the file and restart any services using ImageMagick.
For a user-specific solution, add an alias to your shell configuration file (e.g., ~/.bashrc or ~/.zshrc):
~/.bashrc
~/.zshrc
alias convert='convert -quality 100'
Then reload your shell:
source ~/.bashrc # or source ~/.zshrc
Set the MAGICK_QUALITY environment variable for your current session:
MAGICK_QUALITY
export MAGICK_QUALITY=100
This will apply to all subsequent convert commands in that session.
Note: The policy.xml method is system-wide, while aliases and environment variables are user-specific. Choose the method that best fits your needs!
This is a shared conversation and may include unverified content that doesn't reflect Mistral AI's views. Login to resume chatting.
Vibe can make mistakes. Check answers. Learn more