PDA

View Full Version : making weird effects


klumsy
28th July 2004, 05:14 AM
if you didn't catch my thread with pictures in the inspiration forum about the wierd images my 'dropped' camera is producing here is the link

http://www.vjforums.com/showthread.php?postid=62038

anyhow i am now trying to reproduce the effects in code.. can anybody work out from the images what they think it happening.. it seems to me that different color channels are multiplying by a factor looks like overflow, but it is actually saturating.. strange

anyway here is the first code (3 different ones depending on remmbed out code i made.. to dynamically make this sort of effect, setting red scale sand greenscale and bluescale normally between 1 and 6 produces pleasant effects.. it also produces cool effects in YUV and HSL space.. however not the same as my camera (since this overflows and doesn't saturate).. still trying to work it out in my head.. maybe i should take sets of picture (one with a camera working fine, and one with the damaged camara and see if anybody can work out what is happening.. cause it would make an awesome effect plugin..


well here is the inner loop my code so far.. (still using slow double multiplication each pixel).. using 32 bit ARGB colourspace

for (int nOffset = 0; nOffset < (m_nXRes*m_nYRes); nOffset++)
{
pixel = pSource[nOffset];
red = (pixel & 0x00ff0000) >> 16;
//red = 255-((int)((double)(255-red)*(double) m_fRedBrightness)%256);
// red = ((int)((double)(red)*(double) m_fRedBrightness)%256);
tmp=((int)((double)(255-red)*(double)m_fRedBrightness)%320)-(320-256);
if(tmp<0) tmp=0;
red=255-tmp;
green = (pixel & 0x0000ff00) >> 8 ;
//green = 255-((int)((double)(255-green)*(double) m_fGreenBrightness)%256);
// green = ((int)((double)(green)*(double) m_fGreenBrightness)%256);
tmp=((int)((double)(255-green)*(double)m_fGreenBrightness)%320)-(320-256);
if(tmp<0) tmp=0;
green=255-tmp;

blue = pixel & 0x000000ff;
//blue = 255-((int)((double)(255-blue)*(double) m_fBlueBrightness)%256);
// blue = ((int)((double)(blue)*(double) m_fBlueBrightness)%256);
tmp=((int)((double)(255-blue)*(double)m_fBlueBrightness)%320)-(320-256);
if(tmp<0) tmp=0;
blue=255-tmp;

pDest[nOffset] = (red << 16) | (green<< 8) | blue;
}

syzygy
28th July 2004, 12:31 PM
print out an image with lots of different colours on it in a grid and photograph it - that way we will be able to clearly see what happens to each hue and shade.

A greyscale image would be useful too, to see whether the efffect on manipulates hue or whether it creates colour where there was none before...

Dan.