Frost is giving me fits. It works perfectly in terms of scattering the pixels, but it simultaneously wraps pixels that get pushed from the top or left edges of the bitmap to the bottom and right sides. It also starts to lag with larger images (even at one pass) which makes me think the code is a bit chunky. Heres a good example of what I mean:

frosted to 24
I'll post the code to frost if you want to take a look at it. In the meantime, I'm going to take another whack at pixelate.
As for the emboss, I thought an embossed image had to be devoid of colors. The emboss method leaves some colors behind. It should be a easy fix though; just loop through the pixels a second time and put them into grayscale or monochrome.
Content Hidden
Spoiler

frosted to 24
I'll post the code to frost if you want to take a look at it. In the meantime, I'm going to take another whack at pixelate.
- extern "C" _declspec (dllexport) BOOL Frost(long object, int passes){
- RGSSBMINFO *bitmap = ((RGSSBITMAP*) (object<<1)) -> bm -> bminfo;
- DWORD rowsize;
- DWORD width, height;
- LPBYTE row;
- long x, y, z;
- int randomx, randomy;
- if(!bitmap) return false;
- width = bitmap -> infoheader -> biWidth;
- height = bitmap -> infoheader -> biHeight;
- rowsize = width * 4;
- row = (LPBYTE) (bitmap -> firstRow);
- //srand((unsigned)time(0));
- for ( y = 0; y < (int) height; y++) {
- LPBYTE thisrow = row;
- for ( x = 0; x < (int) width; x++) {
- randomx = 0;
- randomy = 0;
- //Summate the random, so as to avoid repeating the whole process for each pass.
- //LPBYTE newrow = thisrow;
- for ( z = 0; z <= passes - 2; z++) {
- randomx += ((rand() % - 5) + 2);
- }
- for ( z = 0; z <= passes - 2; z++) {
- randomy += ((rand() % - 5) + 2);
- }
- if((y > 0) && ((y + randomy) < (int) height) && ((x + randomx) < (int) width)) {
- LPBYTE newrow = thisrow;
- newrow -= (randomy * (width * 4));
- newrow += (randomx * 4 );
- thisrow[2] = newrow[2];
- thisrow[1] = newrow[1];
- thisrow[0] = newrow[0];
- thisrow[3] = newrow[3];
- }
- else {
- thisrow[2] = 0;
- thisrow[1] = 0;
- thisrow[0] = 0;
- thisrow[3] = 0;
- }
- thisrow += 4;
- }
- row -= rowsize;
- }
- return true;
- }
Expand to see the code.
As for the emboss, I thought an embossed image had to be devoid of colors. The emboss method leaves some colors behind. It should be a easy fix though; just loop through the pixels a second time and put them into grayscale or monochrome.

