DMJ Colorize

From Ultrafractal Wiki

Jump to: navigation, search

Gill,

"I've managed to find DMJ_Colorize in dmj5.ulb, but DMJ_ImageColorize hasn't appeared so far - I was trying to load it into the Color Transfer slot in Orbit Traps Direct (UF5) from dmj5.ucl, where Null Color Transfer appears by default but it wasn't visible in dmj5.ulb."

DMJ_Colorize is a ColorTransfer, so any formula (like Orbit Traps Direct) which has a ColorTransfer slot will accept DMJ_Colorize.

DMJ_ImageColorize is actually of the Image Wrapper type, the same type as ImageImport. Most classes which allow images to be imported do so either by using an Image Wrapper slot (into which any Image Wrapper- compatible object can be placed) or by using a ColorTrap slot (into which ColorTrapImage can be placed, which contains an Image Wrapper slot).

UF automatically shows you only the "compatible" objects for whatever slot you're selecting for. If you click to load a new object in an Image Wrapper slot, you'll be able to choose any Image Wrapper object; at the moment that seems to be just ImageImport (from common.ulb) and DMJ_ImageColorize (from dmj5.ulb). More are planned. Similarly, when you click to load an object into a ColorTransfer slot, the only compatible options at the moment seem to be NullColorTransfer (from common.ulb) and DMJ_Colorize (from dmj5.ulb).

Internally, DMJ_ImageColorize uses the DMJ_Colorize object, so when I update the options for DMJ_Colorize, DMJ_ImageColorize will automatically get them.

For fun, try using a coloring formula which accepts ColorTrap objects (like Orbit Traps Direct). Then load DMJ_BlurTrapWrapper as your trap shape, and stick a ColorTrapImage object inside it. In the future I will probably write some more code to do the same thing in different ways, but this way works right now.

This is one of the cool things about the object system: we can add on to existing tools without having to rewrite them completely. Notice how someone decided they didn't like having to choose all the various trap shapes through the browser; they wanted a simple drop-down list they could scroll through. Well, with the object system, they could do exactly that, creating a wrapper around the entire taxonomy of known trap shapes.

Damien Jones

Personal tools