Manipulação de imagens no OSX com comando SIPs

  • Post author:
  • Post category:Geral

No OS  X existe um comando chamado sips que possibilita a manipulação de imagens sem a necessidade de Photoshop.

Segue abaixo alguns exemplos de utilização do comando:

Batch resize group of pictures with sips

Though most Mac users will likely prefer to use Preview to batch resize images because of the ease of use, advanced users often like to go with the command line for repetitive tasks. We’vediscussed sips before as a way to resize, rotate, and flip images, but if sips is combined with wildcards it can also function as a quick way to batch resize a group of photos.

Launch Terminal from the /Application/Utilities/ folder and use the following syntax:

sips -Z (max height in pixels) /path/to/images/*.(image file extension)

For example, to resize a collection of jpg pictures to each have a max height of 620, located in the desktop folder “ResizeMe”:

sips -Z 620 ~/Desktop/ResizeMe/*.jpg

The -Z flag instructs sips to retain the images original aspect ratio while maintaining a maximum height of 620, but you can also specify exact height and width by using a lowercase -z flag instead like so:

sips -z 620 840 *.jpg

The height in pixels is first, followed by the width in pixels.

If the command line doesn’t fit well into a workflow, another great option is to batch resize imageswith an Automator script, which has the added benefit of becoming a self-contained application allowing for standard Finder interactions like drag and drop.