The Really fast way to GreyScale Images (DirectX)
BlitzMax Forums/BlitzMax Beginners Area/The Really fast way to GreyScale Images (DirectX)
| ||
. See Other Thread |
| ||
Very nice. I'm guessing there are tons of render states such as AND, OR, XOR, BLEND, ALPHA, DIFFUSE, BUMPMAP, .. http://www.toymaker.info/Games/html/texture_states.html For the greyscale example I find a dwFactor of $50FEFF produces a good result. I knocked this example up which lets you quickly change the dwFactor by using the keys 1-8 to change the digits in the hex value: dwFactor $ 0 0 0 0 0 0 0 0 ^ ^ ^ ^ ^ ^ ^ ^ Key 8 7 6 5 4 3 2 1 MOUSE1 = toggle effect on/off * BTW, the Render2Texture demo runs (max app window appears) then closes down promptly. |
| ||
Hmmn, Perhaps you could try the example again, this time you will get a console window that should display the error. |
| ||
Ouch, the coude seems interesting. But I can't get the proper results with it. BlackSp1der has posted some source code related to pixmaps which is quite fast. |
| ||
Same again Tim. No console appears though. |
| ||
@Jim, Sure you did not download the old cached file? The new file is a debug build with a console. |
| ||
Works now. I re-downloaded as Example3.rar |
| ||
It works?!?!? I did not change anything apart from the debug build. |
| ||
I have 2 versions here: render2image.exe at 923Kb - Does not work (pops up and closes) render2image.exe at 561Kb - Works (complete with DOS output) Have you looked at other render methods such as Invert, XOR, AND, etc .. The Amiga Blitz2 had these and it would be nice to have a play with this sort of stuff again. |
| ||
Very interesting, although the default values also seem to convert it to negative (black becomes white, and vice-versa) I've been playing with the parameters, but don't see any way to prevent that from happening? |
| ||
Does a factor of $50FEFF help? |
| ||
Does a factor of $50FEFF help? Nope, had already tried that after seeing the posting above. I have a mostly-orange image (clouds) with a dark line of trees at the bottom. The trees will still turn almost completely white with the $50FEFF, or anything tlese I tried so far. |
| ||
Can people post some screen shots, it looks like some may be getting negative images, whereas I am not. |
| ||
OK, here's an example:![]() ![]() (This is using the SetMono($FFFF0000) from your original example up above... The most obviously 'wrong' part are the trees, which should be black if all it does is convert to B&W. Additionally, it looks like the modified version has an enormous increase in visual artifacts over the original, although that could be related to the higher contrast of the B&W version. (Although desaturating the image in a paint program does not appear to increase the visibility of artifacts) And even though the colors are apparently reverses, it's no a true negative either, because if I invert the colors of the B&W picture shown by your code, it looks a lot darker than when I manually desaturate the color image in a paint program. |