Image filtering

Posted: October 1, 2012 in clisk
Tags: , , ,

Released clisk 0.4.4 with functionality to support image filters.

Example below:

(let [filt (com.jhlabs.image.BoxBlurFilter.)]
  (. filt setRadius 8)
  (show (image-filter filt cannon)))


The implementation is very general purpose – it basically allows any BufferedImageOp to be used as a filter.

Since BufferedImageOps operate on BufferedImages, this poses a slightly interesting problem when applied to clisk image functions (which are arbitrary precision image generators). The solution I chose to handle this is simply to render the clisk image into a BufferedImage to allow the filter to be applied, then convert back to a texture-map so that it can be used in following image functions. Not particularly elegant, but it seems to work OK.

I was happy to stumble across an excellent open source library of Java image filters – Image Filters at JHLabs. So now clisk has a great library of image filters at your disposal, thanks to the power of open source!

  1. Scott Parker says:

    This is looking very promising. I’m doing some experimental image processing in Quil today, but would love to switch over to clisk eventually.

    Keep up the good work!

    • mikera7 says:

      Hi Scott, glad you like it! FWIW, I think Clisk and Quil are targeted at slightly different use cases: Quil is more focused on realtime drawing / animation / live coding while clisk is more about complex image generation / processing (which might well be too much to do in realtime). The output of clisk is just a BufferedImage, which you need to render somehow – possibly via Quil!

      • Scott Parker says:

        Indeed. Since I don’t have much need of animation or realtime, Quil is a bit of overkill for me, but seemed like the easiest way to draw on a canvas and then apply successive transformations.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s