Post ASqCALIiHTdhM0F67k by ottaross@mastodon.social
(DIR) More posts by ottaross@mastodon.social
(DIR) Post #ASoQOwQe2yafbHt7j6 by simon@fedi.simonwillison.net
2023-02-18T18:31:03Z
1 likes, 3 repeats
TIL that macOS ships with a default CLI command called "sips", for "scriptable image processing system" - and it can convert webp images to PNG, but it can also generate entirely new images from scratch using an almost entirely undocumented canvas-based JavaScript API! https://til.simonwillison.net/macos/sips
(DIR) Post #ASoQcLOEYNQYmS9Qq8 by thomasfuchs@hachyderm.io
2023-02-18T18:33:23Z
0 likes, 0 repeats
@simon They’ve had sips since at least the mid oughts. Extremely useful also to access proper color profile functionality (which is still wonky in other tools).
(DIR) Post #ASoQoXmqHuJWhhTl9k by subrandom@ioc.exchange
2023-02-18T18:34:38Z
0 likes, 0 repeats
@simon that’s interestingness I’ve always installed a utility like ImageMagik, etc for that kind of thing. Can’t wait to try it out.
(DIR) Post #ASoSolSxd0nv2PPdTM by segv11@mastodon.online
2023-02-18T18:57:56Z
0 likes, 0 repeats
@simon This is exactly the kind of MacOS trick I've been looking for. Saved! Good alternatives to ImageMagick are just so tough to find.
(DIR) Post #ASoTX5IhFHPJILkEzY by simon@fedi.simonwillison.net
2023-02-18T19:06:19Z
0 likes, 0 repeats
As far as I can tell the only documentation on how to use the JavaScript API is this unofficial documentation here https://github.com/manicmaniac/sips-js-apg
(DIR) Post #ASoU8J2X7rqqcZvvEG by glaforge@uwyn.net
2023-02-18T19:10:25Z
0 likes, 0 repeats
@simon wrong link?
(DIR) Post #ASoUakCliiaAyrHURs by seldo@alpaca.gold
2023-02-18T19:18:55Z
0 likes, 0 repeats
@simon !!!
(DIR) Post #ASoUcsUNtJ6bFiXQES by ash@icosahedron.website
2023-02-18T19:18:33Z
0 likes, 0 repeats
@simon sips also can print the size of an image, and had some nice resize modes
(DIR) Post #ASoVDwZTg0bwcyawDI by simon@fedi.simonwillison.net
2023-02-18T19:20:01Z
0 likes, 0 repeats
@glaforge oops, thanks - fixed (hooray for the edit button)
(DIR) Post #ASoVP4DLbGtXW9Y0W0 by developit@mastodon.social
2023-02-18T19:22:11Z
0 likes, 0 repeats
@simon soooo... who is going to build a wrapper around this that implements a Node/Deno-like stdlib so we can have ~0kb JS CLI's on MacOS?
(DIR) Post #ASoVYrdZDTXLPFU19k by simon@fedi.simonwillison.net
2023-02-18T19:26:43Z
0 likes, 0 repeats
@developit it supports console.log() so yeah, you could totally use it like that
(DIR) Post #ASoWD3YmJ6PPy2PNfU by phy@home.social
2023-02-18T19:36:06Z
0 likes, 0 repeats
@simon Interesting… i was hoping it could replace this https://formulae.brew.sh/formula/webp but not the right this. Lol @ “I asked ChatGPT for an example, but it halucinated something that didn't actually work.”
(DIR) Post #ASoXYFdkgjBHT8PBWy by aurynn@cloudisland.nz
2023-02-18T19:51:16Z
0 likes, 0 repeats
@simon well that is extremely interesting
(DIR) Post #ASocJOe9Q5RgpSKOBs by riley@toot.cat
2023-02-18T20:44:32Z
0 likes, 0 repeats
@simon: Thanks! This looks very interesting.
(DIR) Post #ASoccHbpoCNeVNFZei by calebhailey@mastodon.social
2023-02-18T20:48:06Z
0 likes, 0 repeats
@simon nice find!!
(DIR) Post #ASocnVZmDkHl0Xdl4q by andybroomfield@toot.cafe
2023-02-18T20:49:15Z
0 likes, 0 repeats
@simon thanks for the tip, sounds like something useful when paired with a generative art frameworks like Processing or P5.
(DIR) Post #ASogANOt5EEqAs8v0y by developit@mastodon.social
2023-02-18T21:27:50Z
0 likes, 0 repeats
@simon I smell a weekend project brewing
(DIR) Post #ASohApMdDP6mr8rn4C by film_girl@mastodon.social
2023-02-18T21:39:08Z
0 likes, 0 repeats
@simon @davidgarywood Ooh, also, Simon, looks like sips can be used with AppleScript, which makes complete sense on the js side, that’s actually probably where it comes from. https://ss64.com/osx/sips.html
(DIR) Post #ASoiktslzdRrFUfJHU by toolmantim@mastodon.au
2023-02-18T21:56:29Z
0 likes, 0 repeats
@simon I had no idea it had a JS API!?!
(DIR) Post #ASopDsLNONhmbFFBIW by troz@mastodon.social
2023-02-18T23:09:09Z
0 likes, 0 repeats
@simon I haven’t use the JS features but there’s a section in my book where you learn to wrap a GUI around sips. https://www.kodeco.com/books/macos-by-tutorials
(DIR) Post #ASopcQsIesO2e6LxvE by Sci_Phi@mastodon.social
2023-02-18T23:13:46Z
0 likes, 0 repeats
@simon I had SIPS in some production tooling for a decade and if it had the JS feature back then I totally missed it
(DIR) Post #ASoxBAyAU9DF8Ac0sy by kcarruthers@mastodon.social
2023-02-19T00:38:27Z
0 likes, 0 repeats
@simon @donkey I had not realised. Thanks 🙏
(DIR) Post #ASp34Bj5s96BAyc1rM by whereami@mastodon.social
2023-02-19T01:44:27Z
0 likes, 0 repeats
@simon @caseyliss could it be, another Apple thing without proper documentation?
(DIR) Post #ASpPWqr2kZ95phP5RQ by Oldfart@techhub.social
2023-02-19T05:56:17Z
0 likes, 0 repeats
@simon awesome!Thankssips -j smile.js -o smile.png
(DIR) Post #ASphskjG0IUcNeM36G by pbrdmn@theblower.au
2023-02-19T09:21:45Z
0 likes, 0 repeats
@simon @objectObject > I asked ChatGPT for an example, but it halucinated something that didn't actually work.This feels like the TL;DR of ChatGPT.
(DIR) Post #ASplBLLQuDdn17ldaK by kjvdven@front-end.social
2023-02-19T09:58:38Z
0 likes, 0 repeats
@simonRelated tip: If you quickly want to convert an image in MacOS you can do that under quick actions in the right click menu.
(DIR) Post #ASqCALIiHTdhM0F67k by ottaross@mastodon.social
2023-02-19T15:00:53Z
0 likes, 0 repeats
@simon interesting stuff. I see too, for #python fans, there are hooks into it in the PyPI package generate-iconset> pip install generate-iconset
(DIR) Post #ASqCrN9lG1l1YqZca8 by stevenweaver@mastodon.social
2023-02-19T15:08:40Z
0 likes, 0 repeats
@simon Nice! I’ve often been frustrated trying to convert .webp pages.
(DIR) Post #ASqIHrZHJI0JBGxZj6 by Membranophonist@social.vivaldi.net
2023-02-19T16:09:20Z
0 likes, 0 repeats
@simon I wish sips supported outputting to newer formats such as WebP and AVIF, which would make it very useful in generating image sets for the web when you don’t have an automated processing pipeline in place.
(DIR) Post #ASqKYJK85C1lnyqR5U by cmittendorf@mastodon.social
2023-02-19T16:34:43Z
0 likes, 0 repeats
@simon I always forget that sips exists … as I do forget the textutil shell utiliy.
(DIR) Post #ASqWFESJ9n6OefL6GW by esokullu@onmasto.com
2023-02-19T18:44:37Z
0 likes, 0 repeats
@simon imagemagick 2.0. Is it open-source?
(DIR) Post #ASqWXMtSWWgK2MgedU by alexmcroberts@mastodon.social
2023-02-19T18:49:21Z
0 likes, 0 repeats
@simon this is really interesting timing. I reckon sips will ship on RealityOS for the Apple headset. * alpha transparency will enable occlusion* JavaScript based API for Web Experiences
(DIR) Post #ASqnjZgKV9c6OXx5LU by Sandra@idiomdrottning.org
2023-02-19T21:51:44.091869Z
0 likes, 0 repeats
@simon Me: "Finally a post that's not about ChatGPT!"I followed the link, read first line, then died
(DIR) Post #ASqnjaHCI56WEtCWoK by simon@fedi.simonwillison.net
2023-02-19T22:00:55Z
0 likes, 0 repeats
@Sandra hah! Maybe I should have used a content warningI did get in a little dig at it later on though:> I asked ChatGPT for an example, but it halucinated something that didn't actually work.
(DIR) Post #ASwMMqh9Y51Agc2HRY by erlendaasland@fosstodon.org
2023-02-22T14:23:27Z
0 likes, 0 repeats
@simon That reminded me slightly of Brian Kernighan's PIC markup language.
(DIR) Post #ASzJkqNkeAViHGagPA by marczak@mastodon.social
2023-02-24T00:38:20Z
0 likes, 0 repeats
@simon For quite some time!http://preserve.mactech.com/articles/mactech/Vol.23/23.07/2307MacInTheShell/index.html…and don’t forget textutil