imagemagick
imagemagick
install imagemagick, for example with brew:
brew install imagemagickresize and keep aspect ratio
mogrify can also overwrite existing files and do edits inline
resize on width:
magick mogrify -geometry 256x *.pngresize on height:
magick mogrify -geometry x256 *.pngsvg to png
use convert to create a png out of a svg file:
magick input.svg output.pngchange the background color:
magick -background none input.svg -geometry 2400 output.pngthe background color can be specified like so:
magick -background blue
magick -background "#ddddff"png to svg
convert input.png output.svgif you get an error like:
convert: delegate failed `'potrace' --svg --outputinstall potrace:
brew install potraceand you should be good to go
webp to png
magick mogrify -format png filename.webpanimated webp to gif
magick mogrify -format gif filename.webpimage to c array
useful if you’re going crazy with some cool e-paper/e-ink displays and an esp32.
magick img.bmp img.hmerge multiple images / screenshots
you can play around with the -tile option to position them next to each other … like tiles you know.
montage -mode concatenate -tile 1x image-*.png out.jpgmerge them vertically:
magick input1.png input2.png +append output.pngor horizontally:
magick input1.png input2.png -append output.pngalign them using gravity
if you have multiple sizes and you want them aligned in the center:
convert 1.png 2.png -gravity center -append great.png