%

Bash: Convert, optimize image jpeg/png

Article published the ; modified the
One minute to read

This article has 89 words.
RAW source of the article:
Commit version: e21600e

Description

The script helps you to convert easy and optimize images jpg/png.

Three options:

  • jpg2jpg: to optimize an image jpeg with a ratio to 70%.
  • jpg2png: to convert an image jpg to an optimized image png. <span class"red">Be carefull: the weigth grows up!.
  • png2png: to optimize an image png.

Please, install before using thoses tools:

  • mogrify, by the package ImageMagick
  • jpegtran, by the librarie libjpeg
  • pngnq
  • gvfs-info, by the package gvfs-bin

The script : convert_image()

File: convert_image

Utilisation

Use as exemple:

$ chmod 0700 convert_image $ ./convert_image /name_dir/ option