The filter scripts in this tutorial are all Python wrappers for Apple software in the Core Image system. I have used SWIG to wrap the Core Image code so that we can use these filters in our Python programs.
For all of the Python scripts below, you can click on the image to download the script. The filter name is a link to the Apple documentation of the Core Image filter wrapped by the Python code.
All the scripts below use one or more of the images below as input, so you will need to download them, too.
![]() |
![]() |
![]() |
| | | |
![]() |
from Image import *
p = Image("duchamp.tif")
p.ColorControls(1, .3, .5)
p.save("ColorControls.jpg")
|
![]() |
from Image import *
p = Image("duchamp.tif")
p.ExposureAdjust(-1)
p.save("ExposureAdjust.jpg")
|
![]() |
from Image import *
p = Image("duchamp.tif")
p.GammaAdjust(2.2)
p.save("GammaAdjust.jpg")
|
![]() |
from Image import *
p = Image("duchamp.tif")
p.HueAdjust(2)
p.save("HueAdjust.jpg")
|
![]() |
from Image import *
p = Image("duchamp.tif")
p.ColorInvert()
p.save("ColorInvert.jpg")
|
![]() |
from Image import *
p = Image("duchamp.tif")
p.ColorPosterize(5)
p.save("ColorPosterize.jpg")
|
![]() |
from Image import *
p = Image("duchamp.tif")
p.SepiaTone(.8)
p.save("SepiaTone.jpg")
|
![]() |
from Image import *
p = Image("duchamp.tif")
p.BumpDistortion(Vector(p.width/2,p.height/2), 120, 5)
p.save("BumpDistortion.jpg")
|
![]() |
from Image import *
p = Image("duchamp.tif")
p.CircularSplashDistortion(Vector(p.width/2,p.height/2), 100)
p.save("CircularSplashDistortion.jpg")
|
![]() |
from Image import *
p = Image("duchamp.tif")
p.CircularWrap(0, Vector(p.width/2,p.height/2), 50)
p.save("CircularWrap.jpg")
|
![]() |
from Image import *
p = Image("duchamp.tif")
p.HoleDistortion(Vector(p.width/2,p.height/2), 100)
p.save("HoleDistortion.jpg")
|
![]() |
from Image import *
p = Image("duchamp.tif")
p.PinchDistortion(Vector(p.width/2,p.height/2), 150, -2)
p.save("PinchDistortion.jpg")
|
![]() |
from Image import *
p = Image("duchamp.tif")
p.ColorMap(Image("puchamd.tif"))
p.save("ColorMap.jpg")
|
![]() |
from Image import *
p = Image("duchamp.tif")
p.UnsharpMask(.9, 5)
p.save("UnsharpMask.jpg")
|
![]() |
from Image import *
p = Image("duchamp.tif")
p.GaussianBlur(10)
p.save("GaussianBlur.jpg")
|
![]() |
from Image import *
p = Image("duchamp.tif")
p.MedianFilter()
p.save("MedianFilter.jpg")
|
![]() |
from Image import *
p = Image("duchamp.tif")
p.MotionBlur(15, 3.14159/6)
p.save("MotionBlur.jpg")
|
![]() |
from Image import *
p = Image("duchamp.tif")
p.NoiseReduction(.3, .8)
p.save("NoiseReduction.jpg")
|
![]() |
from Image import *
p = Image("duchamp.tif")
p.SharpenLuminance(.2)
p.save("SharpenLuminance.jpg")
|
![]() |
from Image import *
p = Image("duchamp.tif")
p.Bloom(5, .8)
p.save("Bloom.jpg")
|
![]() |
from Image import *
p = Image("duchamp.tif")
p.Edges(5)
p.save("Edges.jpg")
|
![]() |
from Image import *
p = Image("duchamp.tif")
p.Gloom(8, .9)
p.save("Gloom.jpg")
|
![]() |
from Image import *
p = Image("duchamp.tif")
p.HeightFieldFromMask(5)
p.save("HeightFieldFromMask.jpg")
|
![]() |
from Image import *
p = Image("duchamp.tif")
p.Pointillize(10, 0)
p.save("Pointillize.jpg")
|
![]() |
from Image import *
p = Image("duchamp.tif")
p.BlendWithMask(Image("puchamd.tif"), Image("pdm.tif"))
p.save("BlendWithMask.jpg")
|
![]() |
from Image import *
p = Image("duchamp.tif")
p.ColorBlendMode(Image("puchamd.tif"))
p.save("ColorBlendMode.jpg")
|
![]() |
from Image import *
p = Image("duchamp.tif")
p.ColorBurnBlendMode(Image("puchamd.tif"))
p.save("ColorBurnBlendMode.jpg")
|
![]() |
from Image import *
p = Image("duchamp.tif")
p.ColorDodgeBlendMode(Image("puchamd.tif"))
p.save("ColorDodgeBlendMode.jpg")
|
![]() |
from Image import *
p = Image("duchamp.tif")
p.DarkenBlendMode(Image("puchamd.tif"))
p.save("DarkenBlendMode.jpg")
|
![]() |
from Image import *
p = Image("duchamp.tif")
p.DifferenceBlendMode(Image("puchamd.tif"))
p.save("DifferenceBlendMode.jpg")
|
![]() |
from Image import *
p = Image("duchamp.tif")
p.ExclusionBlendMode(Image("puchamd.tif"))
p.save("ExclusionBlendMode.jpg")
|
![]() |
from Image import *
p = Image("duchamp.tif")
p.HardLightBlendMode(Image("puchamd.tif"))
p.save("HardLightBlendMode.jpg")
|
![]() |
from Image import *
p = Image("duchamp.tif")
p.HueBlendMode(Image("puchamd.tif"))
p.save("HueBlendMode.jpg")
|
![]() |
from Image import *
p = Image("duchamp.tif")
p.LightenBlendMode(Image("puchamd.tif"))
p.save("LightenBlendMode.jpg")
|
![]() |
from Image import *
p = Image("duchamp.tif")
p.LuminosityBlendMode(Image("puchamd.tif"))
p.save("LuminosityBlendMode.jpg")
|
![]() |
from Image import *
p = Image("duchamp.tif")
p.MultiplyBlendMode(Image("puchamd.tif"))
p.save("MultiplyBlendMode.jpg")
|
![]() |
from Image import *
p = Image("duchamp.tif")
p.OverlayBlendMode(Image("puchamd.tif"))
p.save("OverlayBlendMode.jpg")
|
![]() |
from Image import *
p = Image("duchamp.tif")
p.SaturationBlendMode(Image("puchamd.tif"))
p.save("SaturationBlendMode.jpg")
|
![]() |
from Image import *
p = Image("duchamp.tif")
p.ScreenBlendMode(Image("puchamd.tif"))
p.save("ScreenBlendMode.jpg")
|
![]() |
from Image import *
p = Image("duchamp.tif")
p.SoftLightBlendMode(Image("puchamd.tif"))
p.save("SoftLightBlendMode.jpg")
|
![]() |
from Image import *
p = Image("duchamp.tif")
p.Edges(10)
p.Pointillize(3, 0)
p.SepiaTone(.5)
p.save("Combined.jpg")
|