Ask Different (Apple)
Q&A for power users of Apple hardware and software
Latest Questions
10
votes
2
answers
8351
views
Convert .png image icon to .icns file (MacOS)
What command can I type in my BASH shell to convert a given icon in `png` format into the `icns` image format required by Apple `.app` directories?
What command can I type in my BASH shell to convert a given icon in
png
format into the icns
image format required by Apple .app
directories?
Michael Altfield
(745 rep)
Oct 3, 2020, 04:35 PM
• Last activity: Dec 11, 2023, 04:25 PM
1
votes
2
answers
854
views
What does sips --man option do
`sips`, or “scriptable image processing system” is a command-line tool shipping by default with macOS which allows basic image manipulation (think ImageMagick but not as powerful). I found something odd on it’s `man` page: --man Generate man pages It’s not clear at all why this tool would benefit fr...
sips
, or “scriptable image processing system” is a command-line tool shipping by default with macOS which allows basic image manipulation (think ImageMagick but not as powerful).
I found something odd on it’s man
page:
--man
Generate man pages
It’s not clear at all why this tool would benefit from a way to generate man pages, nor how the feature works. What does it do and how does one use it?
user137369
(1666 rep)
Jun 6, 2022, 05:08 PM
• Last activity: Jun 7, 2022, 03:45 PM
1
votes
1
answers
864
views
Sips: resize image's smallest side, not largest side
The command `sips -z 2000 image.jpg` will resize the biggest side of an image to 2000 if it is greater than 2000, while preserving the original aspect ratio. Is there a similar command that will resize the smallest side of an image to 2000 if it is greater than 2000, while preserving the original as...
The command
sips -z 2000 image.jpg
will resize the biggest side of an image to 2000 if it is greater than 2000, while preserving the original aspect ratio.
Is there a similar command that will resize the smallest side of an image to 2000 if it is greater than 2000, while preserving the original aspect ratio?
The rationale behind this request is that if I try to downsize the greatest side of an image to 2000, it will greatly affect the resolution of panoramas and other long/wide images.
Oion Akif
(9414 rep)
Dec 24, 2020, 09:32 PM
• Last activity: Dec 25, 2020, 07:30 AM
2
votes
1
answers
449
views
force sips command to write output to stdout
I wrote a script that convert a icns file to png and then encode the png with base64. I could do it in 2 steps: - `sips -s format png test.icns -o test.png` - `base64 -w0 test.png` But since `test.png` is just an intermediary file, I'd like to pipe the output of the 1st command directly to `base64`,...
I wrote a script that convert a icns file to png and then encode the png with base64.
I could do it in 2 steps:
-
sips -s format png test.icns -o test.png
- base64 -w0 test.png
But since test.png
is just an intermediary file, I'd like to pipe the output of the 1st command directly to base64
, how do I do that?
Note that sips
doesn't seem to support /dev/stdout
as the argument of -o
.
Teddy C
(1884 rep)
Nov 22, 2020, 07:20 AM
• Last activity: Nov 22, 2020, 09:12 AM
3
votes
1
answers
411
views
Sips not working with pict, qtif and sgi files
The terminal command `sips -s format pict /path/to/image.ext --out /path/to/output.pic` ouputs `Error: Unsupported output format com.apple.pict` even though if you do `man sips` and go down to format, there is written that it supports `jpeg | tiff | png | gif | jp2 | pict | bmp | qtif | psd | sgi |...
The terminal command
sips -s format pict /path/to/image.ext --out /path/to/output.pic
ouputs Error: Unsupported output format com.apple.pict
even though if you do man sips
and go down to format, there is written that it supports jpeg | tiff | png | gif | jp2 | pict | bmp | qtif | psd | sgi | tga
.
Is this normal and can you fix it anyway?
Tyilo
(5587 rep)
May 15, 2011, 02:16 AM
• Last activity: Nov 1, 2019, 02:11 PM
1
votes
0
answers
380
views
Sips image resize: Background cover
Using SIPS, I can proportionally resize an image using `sips -Z 256` to reduce the width and height of my image to a size no larger than 256px. Over a padded background fill, this produces a result similar to a CSS `background-size: contain` resize. However, what I'd like to get is a crop of 256x256...
Using SIPS, I can proportionally resize an image using
How would I achieve this result, instead?
It would be nice if I could apply something like cv2 to get a
sips -Z 256
to reduce the width and height of my image to a size no larger than 256px. Over a padded background fill, this produces a result similar to a CSS background-size: contain
resize.
However, what I'd like to get is a crop of 256x256, similar to a CSS background-size: cover
resize, where the width and height are proportionally reduced to a canvas no smaller than 256px.
sips -Z 256 "$file" --cropToHeightWidth 256 256
is close to what I'm after, but the Z
flag is leaving one side too small.


background:cover
style proportional scale with a crop position which defaults to a center-crop, but adjusts the position to prevent faces from being cropped out of the image.
iRyanBell
(111 rep)
Oct 7, 2019, 08:40 AM
• Last activity: Oct 7, 2019, 04:38 PM
1
votes
1
answers
2944
views
Command line to create a PDF document from a batch of images
How to create a PDF document from a batch of images ? === Belowis what I tried before posting this question: The **ImageMagick** way, but the PDF document generated is too big: convert *.ppm book.pdf The **Preview** tool way, the created document is much smaller but it creates margins. The **sips**...
How to create a PDF document from a batch of images ?
===
Belowis what I tried before posting this question:
The **ImageMagick** way, but the PDF document generated is too big:
convert *.ppm book.pdf
The **Preview** tool way, the created document is much smaller but it creates margins.
The **sips** way, not working for some reason:
sips -s format pdf *.ppm --out 'book.pdf' 1>/dev/null 2>&1
There also **img2pdf** which looks good but I couldn't install it on mac (it's not in brew's list of packages).
DevonDahon
(185 rep)
Jan 3, 2019, 08:50 AM
• Last activity: Jan 3, 2019, 09:43 AM
0
votes
1
answers
1509
views
Can I use SIPS to reduce the size of PNG files by reducing the number of palette colors?
I need to shrink [PNG](http://www.libpng.org/pub/png/book/chapter08.html) files like the ones generated as the default macOS screenshot. [SIPS](https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man1/sips.1.html) was my first stop since it's faster than any other solu...
I need to shrink [PNG](http://www.libpng.org/pub/png/book/chapter08.html) files like the ones generated as the default macOS screenshot. [SIPS](https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man1/sips.1.html) was my first stop since it's faster than any other solution but I haven't quite been able to find the right command.
This is my starting point to reformat to PNG:
/usr/bin/sips -s format png "$f" --out "${f%.*}.png"
Which options are needed?
--setProperty bitsPerSample
Bits/sample looks promising but I'm not sure what to enter here.
Does 32 mean 32 colors in this context, for example? Can I use SIPS to quickly reduce the number of colors to shrink file size?
Does 32 mean 32 colors in this context, for example? Can I use SIPS to quickly reduce the number of colors to shrink file size?
SeanJ
(398 rep)
Oct 25, 2016, 02:23 PM
• Last activity: May 31, 2018, 04:11 AM
5
votes
2
answers
2063
views
Why setting image as its own icon with sips result a blurred icon? Are there any alternatives?
I've successfully changed icons using the procedure described in an another question: [Changing or setting a file or folder icon programmatically.][q] Either my `sips` (or Finder) got broken afterwards or I just zoomed in for the first time (it seems the icon is sharp from ≈100x100 downwards), but,...
I've successfully changed icons using the procedure described in an another question: Changing or setting a file or folder icon programmatically. Either my
What I did before the blurrification:
$ cp FIN-2.png FIN-3.png
$ sips -i FIN-3.png
So FIN-2 and FIN-3 are the same. FIN-2 is a 512x512 PNG-file
**Furthermore:** using
sips
(or Finder) got broken afterwards or I just zoomed in for the first time (it seems the icon is sharp from ≈100x100 downwards), but, anyway, the icon that sips -i image.png
creates is blurry/pixelated:

sips
breaks *all* further attempts when trying to set a custom icon even with *any GUI method* and with *any file* in *any folder*.
Only cure is to delete ~/Library/Caches/com.apple.finder/
and restart Finder. Then changing icon via GUI (drag&drop, copy&paste) works normally with any file.
---
Two main questions—and answering to either one probably solves the problem close enough for me:
2. **How can I set an image as an icon programmatically without using sips -i
(= sips --addIcon
) in the process?** (again, refer to the other question for more comprehensive info)
- Shell (bash) or AppleScript is preferred
- I could convert the PNG to e.g. ICNS if needed.
1. Is sips
broken? Why/How? Can it be fixed; how? (Or is it the Finder? Or something else?)
Jari Keinänen
(8370 rep)
Mar 23, 2011, 12:45 AM
• Last activity: May 20, 2016, 01:35 AM
3
votes
2
answers
733
views
Trying to pass images to shell command using automator
I am creating this service for Finder that will receive image files and pass to a shell command. The idea is this: 1. I select image files on finder. 2. I right click and choose the service I am creating 3. the service receives the files and passes to sips, so it will scale the images to a given siz...
I am creating this service for Finder that will receive image files and pass to a shell command.
The idea is this:
1. I select image files on finder.
2. I right click and choose the service I am creating
3. the service receives the files and passes to sips, so it will scale the images to a given size.
this is how I created it.
sips would run on terminal if I type
sips -z 750 1334 *.png (or any other extension, including *.*)
I am hoping that $* would pass a list of arguments to sips, but this is not working.
How do I do that?

Duck
(2572 rep)
Nov 7, 2014, 07:50 PM
• Last activity: Nov 7, 2014, 08:26 PM
2
votes
1
answers
1320
views
Use sips to pad just the top of an image
I'm trying to add padding to the top of an image using the command line. I've found the `sips` command and I've tried sips --padToHeightWidth 1300 1920 image.png on an image which is 1920 x 1080. However this adds 50px of padding to the top and bottom. Is it possible to just add 100px of padding to...
I'm trying to add padding to the top of an image using the command line.
I've found the
sips
command and I've tried
sips --padToHeightWidth 1300 1920 image.png
on an image which is 1920 x 1080.
However this adds 50px of padding to the top and bottom.
Is it possible to just add 100px of padding to the top?
Is there another tool I should/could be using to do this?
Jacob Tomlinson
(255 rep)
Jul 8, 2014, 01:17 PM
• Last activity: Jul 11, 2014, 10:23 AM
0
votes
3
answers
1064
views
Batch-processing Image Files in a Folder using a folder action with Automator
I'm trying to resize new image files in a folder using a folder action so the files that were already resized to 300x250 don't get resized again. The thing is I'm having issues getting the resizing to happen at all.. Here is my current Automator Workflow: ![enter image description here][1] It works...
I'm trying to resize new image files in a folder using a folder action so the files that were already resized to 300x250 don't get resized again. The thing is I'm having issues getting the resizing to happen at all..
Here is my current Automator Workflow:
It works when I test it by adding "Get Selected Finder Items" but when I close automator and I add new files to the folder nothing happens. I'm using Hazel to move jpgs to the folder, but nothing is happening to the files after they are moved into the folder to be resized

Joe Bobby
(397 rep)
Oct 25, 2013, 09:02 PM
• Last activity: Oct 30, 2013, 06:58 PM
1
votes
1
answers
965
views
SIPS: Only Resize if Image is 315x300?
I'm currently using `sips --resampleHeightWidth 250 300 "S1"` to resize new images in a folder but I think that it might be resizing images that were already resized.. Is there anyway to know this for sure? If not what do I add so I can only resize images taht are 315x300?
I'm currently using
sips --resampleHeightWidth 250 300 "S1"
to resize new images in a folder but I think that it might be resizing images that were already resized.. Is there anyway to know this for sure? If not what do I add so I can only resize images taht are 315x300?
Joe Bobby
(397 rep)
Oct 30, 2013, 05:47 PM
• Last activity: Oct 30, 2013, 06:49 PM
Showing page 1 of 13 total questions