Skip to content

Instantly share code, notes, and snippets.

@evenevan
Last active January 20, 2025 04:51
Show Gist options
  • Save evenevan/0c1cf3d12ba8d38b5f5f58d187fc271d to your computer and use it in GitHub Desktop.
Save evenevan/0c1cf3d12ba8d38b5f5f58d187fc271d to your computer and use it in GitHub Desktop.
convert file formats with magick

if your images are large, you may need to set a larger temp directory on a different disk. set this env variable in a unix-like shell or similar. git bash works well.

export MAGICK_TEMPORARY_PATH=D:\temp

convert a .tif to .jpeg while also scaling the height and width by half

magick mosaic.tif -resize "50%" mosaic.jpeg

convert without any resizing

magick mosaic.jpg mosaic.avif

crop

magick mosaic.tif -crop "65500x5000+0+26500" mosaic8.jpg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment