Gaming Industry News, Views, Ideas and Fears

raster data/vector data

You might have already seen the "Smart Texture Filtering" demo, posted in Flipcode IOTD (Image Of The Day) a while ago. The demo shows how to use smart texture filtering in order to avoid the usual blurry aspect due to bilinear filtering, when zooming on textured polygons.

The bad thing with standard bilinear filtering is that it doesn't care about the nature of the image, blurring all pixels the same way.

The good thing about the demo above is that in addition to preserving sharp lines (or what was intended to be sharp lines in the original texture), it gives a unique look to the rendered image. Unfortunately, it works well only for a very particular set of images.

But without even talking about real time rendering, I was wondering why Photoshop doesn't provide that kind of functionality when resizing images (I am not a Photoshop specialist, maybe it does...). A simple idea would be detect & vectorize image edges, convert the image itself into a vertex color regular grid, clip the grid against vectorized edges segments (that would require some re-meshing here and there), then render the grid into a larger frame buffer. I have no idea if it really works, but, who knows. If you know (or if you think you know), send a letter to Santa Claus.

Anyway, a few related links:

One article that explains how to use Flash to convert raster data (you can save in several format, including autocad's .dxf - but I didn't see .svg in the export format list?).

Autotrace, an open source project that does the same thing. It has an interesting link section, with several relevant links about image processing (edge detection, image quantization, etc.)

Celinea is a soft that does image vectorization too, there is a gallery with some svg files (I was surprized by the number of image vectorization softwares that don't event have a decent showcase gallery...).

SVG, a standard vector graphics file format. There is a demo section on Adobe's site.

The last link is a bit off topics, but interesting anyway. There are some free, trivial to parse vector font data (including about 600 Japanese characters), it's called Hershey Vector Font and you can find it here.

Some quick tests...here is a 75x75 test image:

zenigata01.jpg

As a test I also tried to convert the texture file used in the demo mentioned at the begining of the article (Lizards.tga), the result is not very nice. The vectorization algorithm totally screwed up the black lines:

It is interesting to notice that the lizard image was the perfect example to illustrate that "smart filtering" technique (that detects edges with a very simple method), and at the same time it gives awful result when used with a heavy vectorization algorithm...