It's been a while since I visited 64digits, I nearly forgot all about it. lol
Some awesome stuff has happened since my last visit here. I finished ripping my DVDs, Deus Ex Human Revolution was released, etc.Last week I fired up Game Maker for the first time in a while to develop an image file format I thought up. A long while ago, I made an image format using Game Maker where pixels of similar color would merge together to form a horizontal "streak" of a single color.The idea was good, but my particular implementation at the time wasn't. A pixel can be nearly 17 million different colors, so the similarity threshold had to be very low for the image to be smaller in size than a bitmap, which resulted in a very streaky looking image. A strict threshold could be used to keep the same level of detail as a bitmap, but then the benefit of using streaks to define lines of a single color was outweighed by the fact that way too many of the streaks were describing just a single pixel's worth of information.While zoning out in class last week though, the solution came to me out of the blue. It's really so simple, I don't know why I didn't think of it earlier. Instead of trying to make streaks using all the pixel's color information, split it up into channels. It's much, much easier to make streaks that don't compromise quality when the number of variations is cut from 17 million down to 256. But this approach has more than that going for it. Since the different channels have different streaks of different lengths which are combined when rendering, the image ends up having a much less streaky look even when utilizing lower thresholds.Right now, I'm playing around with some variants on this format. In the main version, images are split into R, G, and B channels. Another variant uses HSV, which can be better or worse depending on the case. Most likely I'll merge the RGB and HSV together and just have a flag in the format that denotes whether it's RGB or HSV.I'm toying with a third variant utilizing indexed colors instead of channels, the first implementation of which I whipped up today. Thanks to the fact that it was a quick job, there's a glitch somewhere resulting in some strange artifacting which I haven't been able to track down just yet:
Ah it's you! The one with the goatse-inspired avatar!
If that's what you see, that's your own issue. lol
Also, here's a zip containing the GMKs for both the image writer and viewer, if anyone's curious: http://64digits.com/users/S3xySeele/CSB.zipPardon the sloppy and uncommented work. =PI would have never thought of using GM for this, and I thought of using GM for a lot of stupid things.
Does it actually save in a few format or does it just apply the effect and save as a BMP/GIF/whatever? I know you posted the GMK and I'm curious, but I'm not on my PC where my GM is :(Aw, man. I see it too.
The image writer opens a BMP, JPG, GIF, etc. and writes it as a new format.
The reader opens the new format and can export the result as a BMP.Also, I haven't tested them on Windows yet. I don't know if there are any differences between the Mac and Windows versions of GM that would result in them not working properly.GM is not very good at image manipulation, especially on a per pixel basis. i found this when trying to make a tile-able, animated perlin/voronoi noise generator. it kept flashing on and off the surfaces, even though the code was very simple at the time, and the surfaces were only 32*32.