I've successfully changed icons using the procedure described in an another question: Changing or setting a file or folder icon programmatically. 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, anyway, the icon that sips -i image.png
creates is blurry/pixelated:
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
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:
- 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.
- Is
sips
broken? Why/How? Can it be fixed; how? (Or is it the Finder? Or something else?)