Welcome to FiltersDllPy home page!


FiltersDllPy is a filters python wrapper, that open the wide filters world to the python users!


  • FiltersDllPy:
    wrap all the filters functions that currently dll has, but hasn't a simple
    interfaces for advanced use. This mean that for functions like getOutputArrayPointers
    or other you have to talk with specific C "functions", like pointers, addressof, etc...
    In the future, I'll create another, more "pythonic", class that will solve this, but for now
    enjoy with this code!
    For more info about this, see the C filters example and its python conversion, so you
    can see with your eyes the problems.
  • Usage:
    For use FiltersDllPy you need only python, ctypes and filtersDll.
  • Download:
    FiltersDllPy here: link
    FiltersDll here (download always the last "Developer release"): link
  • Basic simple installation:
    Unpack this package into a directory. Copy the library (.dll) and image (bpm,jpg, etcc) that you find on filterDll
    package (filtersDll_VERSION/bin/) on the FiltersDllPy directory and execute the python test file!
  • Licence:
    LGPL (http://www.gnu.org/licenses/lgpl.html)
  • Thanks to:
    Michele Petrazzo (main developer), Durand Emmanuel (filtersDll developer and main tester)
    Unipex srl (the company where I work)
  • SourceForce project page:
    GO!

FreeDllPy usage are simple:

#Start to import and instance the class
import FiltersDllPy as FDP
f = FDP.FiltersDllPy()

inImg = "blob2.tif"
outImg = "testFiltersDllPy_output_sobel.jpg"
filterName = "filterSobel"

#Load the image

imageLoaded = f.loadImage(inImg)
imageSobel = f.CreateImageLike(imageLoaded)

#Create a parameter list with the filters syntax
#You can specify the paramters type
par = (("inImage",imageLoaded,FDP.P_IMAGE),
("outImage", imageSobel, FDP.P_IMAGE),
("blurIteration", 1, FDP.P_INT),
("gain", 5, FDP.P_INT),
("thresholdLower", 1, FDP.P_INT),
("thresholdUpper", 255, FDP.P_INT),
)

#or leave the library to found it!
par = (("inImage", imageLoaded),
("outImage", imageSobel),
("blurIteration", 1),
("gain", 5),
("thresholdLower", 1),
("thresholdUpper", 255),
)

#Create a filter and run the paremters over

f.createFilterRun(filterName, par)

#Save the image
f.saveImage(imageSobel, outImg)


Logo SF