
This yields an extremely compact, 8 KB file that will provide pixel-perfect scaling to any size. We don’t want corners to be too rough, but also not too soft, so we’ll use an intermediate value of 40 for the corners option. There are several options that can be specified for the vectorize effect that you can use to control the resulting output, depending on your goals.įor this case, we’ll request an SVG at the maximum detail (1.0) with 3 colors (like the original). To do this, it must perform some approximations, so the result is usually not a completely “lossless” copy of the source, but depending on the source information, it can come very close.

With the new Cloudinary vectorize effect, we can do raster image to vector conversion on-the-fly.Īs mentioned earlier, the vectorize feature works by tracing and detecting paths and areas in the source image and then converting them to SVG vector form. So for example, if we wanted to display this image at 4x the original size, the file size would grow to a much less friendly 337 KB, while the quality would drop significantly, and it would also be highly pixelated. Let’s assume we only have access to a 256px version of the following drawing:īut what if we want to display the image at a larger size? Unfortunately, the blurriness and file size of raster graphics both continually increase with resolution. Suppose you have access to logos, icons, or other graphics in raster form, (probably PNG), but would like to scale them or deliver them in a more compact form.įor this use-case, we want the SVG version to match the original as closely as possible. Let’s take a closer look at some usage options that these new capabilities open up. It provides a variety of options that enable you to generate SVGs with more or less detail, depending on your goals. It achieves this ‘magic’ by tracing and detecting paths and areas in the source image and converting them to SVG vector form. The new e_vectorizetransformation option accepts a raster image and returns an SVG on-the-fly and ready for delivery.

that enables web developers and designers to take advantage of SVG even when the images they have to work with are simple raster graphics, PNGs or even photographic data, and without requiring deep knowledge or special tools for generating vector graphics. But generally, SVG creation requires a certain skill level and experience with SVG creation tools.Ĭloudinary has long supported transforming and serving SVG assets but now Cloudinary has gone a step further by providing a simple vectorize effect.

SVG format has been around forever, but until recently usage has been relatively low.
