I'm currently using ChatGPT as much as possible to do the rather tedious work of wrapping lots and lots of API methods, properties, tons of constants, those sorts of things while there's a free preview available to the public to use/test. It's extremely helpful.
So using that I've been getting into some CoreImage stuff via Extension Builder on macOS.
Which prompted a new Extension Builder library to translate some Python Script I had tried out (ran the Python from a script in OXT). This is likely the beginnings of a much larger library for Image related tasks using the macOS APIs. I'm considering using it to also wrap something in a more cross platform library, such as ImageMagick/GrahicsMagick. But some of the macOS stuff is already functional.
The AI dutifully hammered out the constants declarations for all of the official NSImageNamed images provided by macOS for use in apps built for Apple platforms. However I found a much cooler list on GitHub that included undocumented constants as well. The demo stack retrieves these into a image PNG data (and can also write out all available resolution "representations" to a TIFF file)
https://hetima.github.io/fucking_nsimage_syntax/
Kinda funny to see that macOS still includes NeXT icons, lol.
NSImage ChatGPT etc.
- OpenXTalkPaul
- Posts: 2633
- Joined: Sat Sep 11, 2021 4:19 pm
- Contact:
- OpenXTalkPaul
- Posts: 2633
- Joined: Sat Sep 11, 2021 4:19 pm
- Contact:
Re: NSImage ChatGPT etc.
Bottom line is the image on the right was created by script from the one to its left without any Photoshop being involved.
Like the existing CoreImage effects support in the visual effects command, this doesn't function on non-Apple platforms, however theoretically at least some of this (and maybe some other Builder libraries ) could work on other platforms if we included bindings for GNUStep's UI library, which does contain open-source implementations of some of the objects this uses like NSImage / NSBitmappedImageRepresentations.
I guess I should take some time to look again at how CoreImage syntax was previously implemented in the visual effects command (which still works fine, but has anyone even use it beyond demo stacks?). I'd like to try to stay consistent with syntax any long-time xTalk scripted might be already familiar with. The library needs a way to chain these filters together so we can apply multiple filters in a singe pass though so it will probably wind up being some sort of strings items/lines or a array (I'd prefer an easily inspectable text formatting).
from the dictionary:
Code: Select all
-- MacOS only.
visual effect "CIPageCurlTransition" slow with Angle 1.0 and Radius 70 and Extent "30,30,300,300"
go next card
lock screen for visual effect in rect "30,30,300,300"
go previous card
unlock screen with visual effect "CIModTransition" with Angle -1 and Radius 70
- richmond62
- Posts: 4830
- Joined: Sun Sep 12, 2021 11:03 am
- Location: Bulgaria
- Contact:
Re: NSImage ChatGPT etc.
MacOS containing NeXT icons is no odder than human embryos having tails, or humans having non-functional appendixes.
https://richmondmathewson.owlstown.net/
- OpenXTalkPaul
- Posts: 2633
- Joined: Sat Sep 11, 2021 4:19 pm
- Contact:
Re: NSImage ChatGPT etc.
I just would have thought someone at Apple would've tried to trim some fat at some point since the macOS Installer just kept getting more and more bloated over the years. But it's cool that that's still there after three decades, felt a bit like finding an Easter Egg!richmond62 wrote: ↑Fri Feb 17, 2023 6:53 pm MacOS containing NeXT icons is no odder than human embryos having tails, or humans having non-functional appendixes.
Core Image filtering is working nicely, just added a handler for passing arbitrary amount of filters and parameters in as strings.
Used from a stack Scrollbar script it looks like this:
Code: Select all
on scrollbarDrag pNewPosition
put the short name of (the owner of me ) into tFilterName
get CoreImageFilterWithParamsList( the long id of image "Test Image", \
"CIMotionBlur inputRadius="& pNewPosition &" inputAngle=" & the thumbPosition of scrollbar "ScrollbarB")
set the text of image "Test Image Out" to it
end scrollbarDrag
- OpenXTalkPaul
- Posts: 2633
- Joined: Sat Sep 11, 2021 4:19 pm
- Contact:
Re: NSImage ChatGPT etc.
I want to try wrap the text recognizer filter to get some basic OCR (optical character recognition) capability.
I will probably put this aside after the still image filter category (which is like 100 or so filters), but Core Image Filters can also be used with CoreVideo for filtering movies.
- richmond62
- Posts: 4830
- Joined: Sun Sep 12, 2021 11:03 am
- Location: Bulgaria
- Contact:
Re: NSImage ChatGPT etc.
Why does the URL in the first posting contain the 'F' word? 

https://richmondmathewson.owlstown.net/
- OpenXTalkPaul
- Posts: 2633
- Joined: Sat Sep 11, 2021 4:19 pm
- Contact:
Re: NSImage ChatGPT etc.
richmond62 wrote: ↑Tue Feb 21, 2023 7:11 pm Why does the URL in the first posting contain the 'F' word?![]()

I found this better site from the author of DropDMG created and it's a much more complete documentation of CIFilters than Apple's official (and no longer updated) docs:
https://cifilter.io born of same sort of frustration https://mjtsai.com/blog/2019/04/16/core ... reference/
And his docs are open-source https://github.com/noahsark769/cifilter.io so maybe I'll contribute to it if I find some info is missing.
I was more curious about how they found all of those undocumented constants names (like the NeXT ones), like did they manually sift though every .h header file in the OS collecting them all or what?
ANARCHY IN THE OXT!
Who is online
Users browsing this forum: No registered users and 2 guests