Image Filters

Mac OSX specific forum
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3944
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

Image Filters

Post by wilbert »

OSX has a lot of built in image filters
http://developer.apple.com/library/mac/ ... rence.html

When targeting OSX 10.5, it's not very complicated to wrap some of them into a user library.
Would anyone be interested in this and if so, what do you think are the most useful filters ?
User avatar
J. Baker
Addict
Addict
Posts: 2196
Joined: Sun Apr 27, 2003 8:12 am
Location: USA
Contact:

Re: Image Filters

Post by J. Baker »

wilbert wrote:OSX has a lot of built in image filters
http://developer.apple.com/library/mac/ ... rence.html

When targeting OSX 10.5, it's not very complicated to wrap some of them into a user library.
Would anyone be interested in this and if so, what do you think are the most useful filters ?
Hey WB, I hope you're making some good money with your programming skills. ;)

As for the filters, the noise reduction filter on there is pretty nice and kind of different. It seems it reduces the digital noise but creates an all over noise that seems to add detail to the image. Kind of like upscaling an image but without sharpening it.

The unsharpmask is always a nice sharpening filter. I prefer it over other sharpening filters anyway.

I haven't had a chance to read and view all of them yet but I'm sure there are some other nice ones choose from. ;)
www.posemotion.com

PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef


Even the vine knows it surroundings but the man with eyes does not.
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3944
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

Re: Image Filters

Post by wilbert »

J. Baker wrote:Hey WB, I hope you're making some good money with your programming skills. ;)
I must be doing something wrong there :wink: ; learned last year that an iPhone app in the app store is not the way :(

As for the filters, try for yourself if you wish
The lib : http://www.w73.nl/pb/libPBMX.zip

I combined several things I did in one lib to keep things together a bit, everything starting with MX.
The image related functions are

Code: Select all

MX_Release (object) - Release an object.

Height = MXImage_Height (ImageID)
ImageID = MXImage_LoadFromURL (url.s)
Width = MXImage_Width (ImageID)

NewImageID = MXImageFilter_AffineTransform (imageID, m11.f, m12.f, m21.f, m22.f)
NewImageID = MXImageFilter_Crop (imageID, x.f, y.f, width.f, height.f)
NewImageID = MXImageFilter_ExposureAdjust (imageID, EV.f)
NewImageID = MXImageFilter_ComicEffect (imageID)
NewImageID = MXImageFilter_Grayscale (imageID)
NewImageID = MXImageFilter_NoiseReduction (imageID, noiseLevel.f, sharpness.f)
NewImageID = MXImageFilter_SharpenLuminance (imageID, sharpness.f)
NewImageID = MXImageFilter_UnsharpMask (imageID, radius.f, intensity.f)
The resulting image may not have the same size as the input image.
Other functions in the lib are related to speech and printing. Most likely I will post more on that in another thread.

An example of the image filters

Code: Select all

If OpenWindow(0, 0, 0, 245, 105, "MXImage Demo", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
  
  img = MXImage_LoadFromURL("http://www.purebasic.com/images/box.png")
  If img
    img_t1 = MXImageFilter_Grayscale(img)
    img_t2 = MXImageFilter_AffineTransform (img_t1, -1.5, 0, 0, 0.5)
    ImageGadget(0,  10, 10, 100, 83, img)
    ImageGadget(1, 130, 10, 100, 83, img_t2)
    MX_Release(img_t2)
    MX_Release(img_t1)
    MX_Release(img)
  EndIf
  Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
  
EndIf
Last edited by wilbert on Wed May 31, 2017 3:14 pm, edited 1 time in total.
WilliamL
Addict
Addict
Posts: 1259
Joined: Mon Aug 04, 2008 10:56 pm
Location: Seattle, USA

Re: Image Filters

Post by WilliamL »

Most likely I will post more on that in another thread.
I'm looking forward to seeing a list of the functions included in your library!

If you feel like it, I'd like some instructions of how to put, access, and use the library. It's not something I've used before. :shock:

Maybe a thread just for your library that you can update, as necessary, with additions and fixes. (just an idea..)
MacBook Pro-M1 (2021), Tahoe 26.2, PB 6.30b6
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3944
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

Re: Image Filters

Post by wilbert »

WilliamL wrote:Maybe a thread just for your library that you can update, as necessary, with additions and fixes. (just an idea..)
Good idea :)
http://www.purebasic.fr/english/viewtop ... 19&t=46937
User avatar
J. Baker
Addict
Addict
Posts: 2196
Joined: Sun Apr 27, 2003 8:12 am
Location: USA
Contact:

Re: Image Filters

Post by J. Baker »

wilbert wrote:I must be doing something wrong there :wink: ; learned last year that an iPhone app in the app store is not the way :(

As for the filters, try for yourself if you wish
The lib : http://www.waterlijn.info/pb/libPBMX.zip
Games are the way to go with the iphone.

And thanks!
www.posemotion.com

PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef


Even the vine knows it surroundings but the man with eyes does not.
Post Reply