unix

  1. Using ImageMagick to visually diff images

    3 minute read Published: 2022-11-17

    ImageMagick is a well-known CLI tool that provides image processing capabilities. It can handle hundreds of different image formats and gives you a programmatic interface to create, edit, compose, and convert images. I personally use the convert command very often to resize an image (e.g., convert -resize 300x300 -quality 100 source.png out.png) or convert between different formats. ImageMagick also has the ability to produce a visual diff between two images, by using its compare & montage commands.

  2. jq --slurp

    1 minute read Published: 2022-08-18

    jq --slurp conflates multiple JSON document inputs into a single array. This allows you to run a jq filter only once for all inputs, instead of once per document.