GithubHelp home page GithubHelp logo

tarapara / jh-labs-java-image-filters Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ajmas/jh-labs-java-image-filters

0.0 0.0 0.0 237 KB

A collection of image filters, written in Java

License: Other

Java 100.00%

jh-labs-java-image-filters's Introduction

JH Labs Java Image Filters

Project originally available from: http://www.jhlabs.com/ip/filters/ Original project author: Jerry Huxtable

Note: This project is also exists under the name 'Pixels' from http://java.net/projects/pixels and the source is available at https://svn.java.net/svn/pixels~svn/

Text below is the description as found on Jerry Huxtable's website:

Java Image Filters

I have a large number of Java Image filters which are freely available for download from this site. The filters are all standard Java BufferedImageOps and can be plugged directly into existing programs. All the filters are available in the Java Image Editor and most have dialogs to allow you to play with their settings. If you want to try out any of these filters, I recommend downloading the editor and using the dialogs, which is generally much easier than writing code to try them.

Many of these filters are useful in applications such as games where images need to be generated on the fly, or where it's quicker to generate them rather than downloading them. For instance, it's quicker to download one image and rotate it several times than to download several separate images.

Another use for the filters is in animation. For example animating the Water Ripple filter can produce a nice rippling effect. Some of the filters have a time parameter for this purpose.

Philosophy and General Points

None of these filters are finely-tuned for speed, or even coarsely-tuned. Think of them as sample code for writing your own filters. I've preferred floating-point math over integer or fixed-point pretty well everywhere. By making the appropriate changes you'll probably be able to get these to go quite a bit faster.

All of the filters are designed to work with TYPE_INT_ARGB images. Some may work with other image types, but I make no guarantees.

All the filters are Java beans in the sense that they have default constructors and a set of properties. None of them have BeanInfo classes. This is for three reasons: firstly, the original versions predate the introduction of JavaBeans, and secondly, a BeanInfo class doesn't provide enough information to do a good UI for the properties, and thirdly, writing BeanInfo classes is really boring.

For the UI, we need all sorts of extra information that a BeanInfo doesn't provide: permitted ranges for values, usage (is this float a distance or an angle? what are its units?), grouping of properties and so on. Some of this could be overcome by providing more classes, e.g. having an Angle class, but this would just complicate usage and not provide any obvious benefit beyond a sort of warm object-oriented glow. To do this, I've provided an XML file with each filter which specifies the UI. The format of this file will probably change as the Image Editor UI evolves. The filters don't support serialization. XMLEncoder does a much better job of handling this and I encourage you to use that instead.

Some of the filters have position parameters, e.g. for specifying the centre of the effect. These are generally expressed as a proportion of the width or height of the image in the range 0 to 1 rather than being measured in pixels. This allows the same filter settings to be applied to different size images.

Some filters, such as the transitions, take more than one source image. Where this happens, there are often two ways to call the filter. The first way is to call setXXX() methods on the filter for the extra images and then call the normal filter() method. The second way is to call a new filter() method which takes an array of images as its first parameter. The reasoning behind this is to allow the use of the filters anywhere a BufferedImageOp is allowed, but also to make it more convenient to use filters which require more than one source image.

jh-labs-java-image-filters's People

Contributors

ajmas avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.