A Simple Logo Standardizer Bash Script with Imagemagick

Furkan Kalkan f9282b062f Fix typo 3 years ago
LICENSE 3d38efcbe7 Initial commit 3 years ago
README.md 08374c62fa Update 'README.md' 3 years ago
stdlogo.sh f9282b062f Fix typo 3 years ago

README.md

stdlogo

A Simple Logo Standardizer Bash Script with Imagemagick

This script standardize the size of brand logos in different formats, shapes and sizes with adding whitespace to them.

Requirements

This script use Imagemagick, awk and mktemp.

Usage

./stdlogo.sh <source_path> <target_path>

Default output is 400x230. Supported logo extensions are .png, .jpg and .svg. You can change configuration parameters in script for advanced usecases.

Parameters

OUTPUT_BACKGROUND: Output image background color. Opacity not supported yet but can easily added.

OUTPUT_SIZE: Output image wxh size in pixel.

LOGO_TRIM_FUZZ: Trim whitespace color fuzz value in percent. Useful when work with low quality JPEGs.

LOGO_HEIGHT_TOLERANCE: Logo height tolerance in pixel. If resized logo height smaller than height + tolerance, logo will resize to desired height, otherwise logo will resize to desired width.

LOGO_DESIRED_HEIGHT: Desired logo height in output image.

LOGO_DESIRED_WIDTH: Desired logo width in output image.

Limitations

  • Script won't remove background color for you. For logos with solid background, change background color to OUTPUT_BACKGROUND or use remove.bg like services.
  • Script use trim functionality of imagemagick to remove excessive whitespace from logo. This cause deformations in logo has solid background. Example logo
  • High LOGO_TRIM_FUZZ values may cause deformations in logos.
  • Script won't change logo colors for you to fit OUTPUT_BACKGROUND. You had to do this.