is there lossy vectorization of images for arbitrary compression level?

the article on vectorization suggests that vectorization significantly increases the size of an image. Meanwhile intuitively I would expect that some forms of vectorization ought to lead to serious compression. Kinda like a pencil sketch copy is a trivially vectorizable compression of the original image.

So are there lossy vectorization based compression algorithms out there? Is this an existing research area? Or is this more of a useless and nobody gives a damn area?

Vector graphics are great for shapes that can be described mathematically. That’s not really a good fit for photographs, but is great for things like charts, logos, diagrams, etc.

Meanwhile, JPG works by reusing patterns. This is perfectly suited to photographs and lousy for charts, logos and diagrams.

It is trivial to show that for some images, vectorisation can be more efficient. Take an image with a single black line running diagonally from the top corner to the bottom …

The problem is that there are no consistent approaches to image vectorisation. However, by changing the parameters you can reduce an image to something that is more cartoonlike (by increasing the colour/shading range per band). This could reduce the image size with a loss of detail. But it is not trivial, and not done often. It does have advantages - vector images are scalable without any loss of detail, particularly if bezier curves are used and not multiple line segments (this is computationally difficult to do).

This is why manually drawn vector clipart (.CGM, .WMF etc) are so popular. My wife uses Inkscape trace to generate files from images for cutting - she usually traces the image at low selectivity and then edits/redraws the resulting trace to get good curves and reduced complexity. she is pretty good at it, too.

Si

Vectorization has difficulties with any images containing noise, textures, or gradients. Images with none those characteristics can already be compressed very efficiently using the png format. The best practical application of vectorization as I see it is for enlarging or manipulating rasterized text and line art when higher resolution sources aren’t available.

Vectorization with gradient maps seems to overcome the issues of gradients and would make vectorization potentially much more useful but as far as I can tell it isn’t implemented in a practical way yet. This paper goes over the concept, and you can at least see visually how it would simplify the vectorized form of smooth objects with gradients.

when you say that the operation you are describing here is not trivial, do you mean that it is a particularly expensive computer algorithm? Or is it something done by a human, sort of like photo retouching or the manual sketching that you also mentioned in this post?

There are a number of issues. The first is the process of dividing the image into regions - this is usually done (as I understand it) on the basis of colour or contrast density, with some sort of threshold. But this does not necessarily match how we as humans perceive the regions - we identify features (eyes, cheekbones, nose etc in the case of a face) and interpret based on that. MP3s compress audio data based on a psychoacoustic model, shaping and discarding data based on how humans perceive sound. There is not yet (as far as I can tell) an equivalent psychovisual model that would allow humanlike regionalisation and simplification of arbitrary images. Think about how a cartoonist reduces a face to a few regions and lines, but it is still recognisably a face. Colour/density simplification on a photo does not achieve quite the same effect.

The next problem is algorithmic - we have complex pixel regions that we need to convert to vector objects. They can be defined as line segments, but this is inefficient (ie, there is no compression, and probably expansion of file size). Converting a large set of points to an efficient bezier description (curve fitting) is hard to do as well (all curve fitting is computationally hard). Adjacent edges have to map, so gaps don’t form when the vectors are scaled. You could try merging and layering to simplify regions using mapping techniques, but again, it is not a trivial process.

It would be nice if we could convert images to vectors, with arbitrary detail and compression, but we can’t do that yet, and we may never be able to.

Si

We do have some models for human vision, and one of those is that our resolution for color (hue) and saturation are lower than for brightness. Quite a few lossy compression techniques take advantage of this. But this produces something that is completely unlike vectorization.

We also do have arbitrary levels of vectorization–it’s just that it isn’t based on any psychovisual model. It’s just based on the number of colors. And when you vectorize at too high a level, you get something rather indistinguishable from a raster image, yet with a much larger file size. You lose all the advantage, such as infinite zoom. Oh, and said image is very computationally expensive to make, as each scan takes proportionally more than the last.

I knew an image-compression scientist who had this image by Pablo Picasso on his wall as an example of “image compression.” :cool:

I’ve done very little work with Fractal Compression, of which the best implementations 15 years ago were secret, but I think some versions may be able to compress straight lines automatically. Fractal image compression can be described as VQ-style compression in which the codebook is the image itself(!) reduced and suitably parameterizable.