- Open an image file from the command line
- Check & Change the default Application for a given file type
- Convert Webp to PNG format
- Convert SVG to PNG format
- Trim Pixels off one side of an Image
- Join Two Images Together
- Create Animated GIFs of Terminal Commands
- Inspect Image File Metadata
- Look for Watermarks
- Steghide
- Image Upload Sites
From DevOps-Bash-tools repo, determines whatever tool is available on either Linux or Mac and uses that to open the image file:
imageopen.sh "$filename"This uses the default application for the file type.
brew install dutiCheck default Application for a given file type:
duti -x svgChange this from say Inkscape which is a slow editor for just file viewing, to Google Chrome which is faster:
duti -s com.google.Chrome public.svg-image allmedium.com doesn't support using newer webp format images on the site so you need to convert them first:
On Mac, install the Imagemagick or Webp homebrew packages:
brew install imagemagickor
brew install webpConvert the image using ImageMagick:
magick "$name.webp" "$name.png"or using dwebp:
dwebp "$name.webp" -o "$name.png"or more simply use this script in DevOps-Bash-tools repo which will find / install and use one of the above tools, and protect against overwriting:
webp_to_png.sh "$name.webp"You can also inspect the webp header like this:
webpinfo "$name.webp"Many major websites like LinkedIn, Medium and Reddit do not accept SVG images so you must convert to another supported format like PNG.
Using ImageMagick:
convert "$name.svg" "$name.png"or using Inkscape (slower than ImageMagick):
inkscape "$name.svg" --export-filename="$name.png"or using rsvg-convert:
rsvg-convert "$name.svg" -o "$name.png"or more simply use this script in DevOps-Bash-tools repo which will find / install and use one of the above tools and protect against overwriting:
svg_to_png.sh "$name.svg"Useful for tweaking Screenshots before sharing them.
You can use Imagemagick to do this from the command line more easily than using Gimp.
Use this script from DevOps-Bash-tools repo, as it's easier than using UI tools like Gimp or even ImageMagick directly etc.
image_trim_pixels.sh "$image" <top|bottom|left|right> "$num_pixels"Useful to create memes.
Since images can have different widths and end up with whitespace around the smaller image, use this script from the DevOps-Bash-tools repo to joins them after matching their heights or widths so they align correctly:
image_join_vertical.sh "$top_image" "$bottom_image" "joined_image.png"image_join_horizontal.sh "$left_image" "$right_image" "joined_image.png"From DevOps-Bash-tools:
ttygif.shasciinema.shterminalizer.shCreate custom Terminalizer config:
terminalizer initThe global config directory is created at
/Users/hari/.config/terminalizer
Then edit:
vim ~/.config/terminalizer/config.ymlexiftool "$file"Identify command from imagemagick is more verbose:
identify -verbose "$file"Exiv2 is less reliable:
exiv2 "$file"magick "$file" -edge 1 output.jpgThen visually inspect the output.jpg which is blacked out to see sillouttes more easily.
You can also try converting to black & white (grey):
magick "$file" -channel Red -separate output.jpgThis on only works if you've hidden something inside the image and know the password to extract it:
steghide info "$file"Looks like this is removed from Mac Homebrew, launch it in a debian docker container instead:
steghide extract -sf "$file"See the File Upload & Code PasteBin sites doc.
