I’ve made some minor changes to the blog this morning. The most significant is that I’ve added a file-sharing widget in the right-hand sidebar. (thanks for the suggestion Dr.Goulu) I still plan to upload files to Memo’s QC archive, though.
Archive for May 13th, 2008
13
May
Blog Update
13
May
tb xyMixPixellate
Another in a seemingly endless series of minor variations on the pixellation/glitch theme.
In this version, the image is divided into tiles of variable size. Each tile can be ‘zoomed’ until it becomes a single solid colour (giving a standard pixellation ‘mosaic’ effect). Optionally, the amount of zoom for each tile can be controlled by the luminosity of the centre pixel of each tile.
Leopard-only.
See Box.net widget at bottom of right sidebar for download.
Also now available from Memo’s site.
/*
A simple pixellation effect with mix controls
toneburst 2008
*/
kernel vec4 tb_xyMixPixellate(sampler Image, vec2 Size, vec2 Mix)
{
vec2 xy = samplerCoord(Image);
vec2 xyPix = floor(xy / Size) * Size;
xyPix += 0.5 * Size;
Mix = Mix * 2.0;
vec2 samplePos = mix(xy,xyPix,Mix);
// Output
return sample(Image, samplerTransform(Image, samplePos));
}
and this is the JavaScript from the bottom panel of the CIFilter
function __image main(__image Image, __vec2 Size, __vec2 Mix) {
// Image dimensions
__vec2 dims = new Vec(Image.extent.width, Image.extent.height);
// Size of cells (X and Y)
__vec2 pixSize = new Vec(dims.x / Math.ceil(dims.x * Size.x), dims.y / Math.ceil(dims.y * Size.y));
// Call kernel code and return image
return tb_xyMixPixellate.apply(Image.definition, null, Image, pixSize, Mix);
}