Image tracing

In computer graphics, image tracing, raster-to-vector conversion or raster vectorization is the conversion of raster graphics into vector graphics.

Background

This image illustrates the difference between bitmap and vector images. The bitmap image is composed of a fixed set of pixels, while the vector image is composed of a fixed set of shapes. In the picture, scaling the bitmap reveals the pixels while scaling the vector image preserves the shapes.

An image does not have any structure: it is just a collection of marks on paper, grains in film, or pixels in a bitmap. While such an image is useful, it has some limits. If the image is magnified enough, its artifacts appear. The halftone dots, film grains, and pixels become apparent. Images of sharp edges become fuzzy or jagged. See, for example, pixelation. Ideally, a vector image does not have the same problem. Edges and filled areas are represented as mathematical curves or gradients, and they can be magnified arbitrarily (though of course the final image must also be rasterized in to be rendered, and its quality depends on the quality of the rasterization algorithm for the given inputs).

The task in vectorization is to convert a two-dimensional image into a two-dimensional vector representation of the image. It is not examining the image and attempting to recognize or extract a three-dimensional model that may be depicted; i.e. it is not a vision system. For most applications, vectorization also does not involve optical character recognition; characters are treated as lines, curves, or filled objects without attaching any significance to them. In vectorization, the shape of the character is preserved, so artistic embellishments remain.

Vectorization is the inverse operation corresponding to rasterization, as integration is to differentiation. And, just as with these other two operations, while rasterization is fairly straightforward and algorithmic, vectorization involves the reconstruction of lost information and therefore requires heuristic methods.

Synthetic images such as maps, cartoons, logos, clip art, and technical drawings are suitable for vectorization. Those images could have been originally made as vector images because they are based on geometric shapes or drawn with simple curves.

Continuous tone photographs (such as live portraits) are not good candidates for vectorization.

The input to vectorization is an image, but an image may come in many forms such as a photograph, a drawing on paper, or one of several raster file formats. Programs that do raster-to-vector conversion may accept bitmap formats such as TIFF, BMP and PNG.

The output is a vector file format. Common vector formats are SVG, DXF, EPS, EMF and AI.

Vectorization can be used to update images or recover work. Personal computers often come with a simple paint program that produces a bitmap output file. These programs allow users to make simple illustrations by adding text, drawing outlines, and filling outlines with a specific color. Only the results of these operations (the pixels) are saved in the resulting bitmap; the drawing and filling operations are discarded. Vectorization can be used to recapture some of the information that was lost.

Vectorization is also used to recover information that was originally in a vector format but has been lost or has become unavailable. A company may have commissioned a logo from a graphic arts firm. Although the graphics firm used a vector format, the client company may not have received a copy of that format. The company may then acquire a vector format by scanning and vectorizing a paper copy of the logo.

Process

Original PNG file (16 kB)
Hand converted to SVG (47 kB)

Vectorization starts with an image.

Manual

The image can be vectorized manually. A person could look at the image, make some measurements, and then write the output file by hand. That was the case for the vectorization of a technical illustration about neutrinos. The illustration has a few geometric shapes and a lot of text; it was relatively easy to convert the shapes, and the SVG vector format allows the text (even subscripts and superscripts) to be entered easily.

The original image did not have any curves (except for the text), so the conversion is straightforward. Curves make the conversion more complicated. Manual vectorization of complicated shapes can be facilitated by the tracing function built into some vector graphics editing programs.

If the image is not yet in machine readable form, then it has to be scanned into a usable file format.

Once there is a machine-readable bitmap, the image can be imported into a graphics editing program (such as Adobe Illustrator, CorelDRAW, or Inkscape). Then a person can manually trace the elements of the image using the program's editing features. Curves in the original image can be approximated with lines, arcs, and Bézier curves. An illustration program allows spline knots to be adjusted for a close fit. Manual vectorization is possible, but it can be tedious.

Although graphics drawing programs have been around for a long time, artists may find the freehand drawing facilities awkward even when a drawing tablet is used. Instead of using a program, Pepper recommends making an initial sketch on paper. Instead of scanning the sketch and tracing it freehand in the computer, Pepper states: "Those proficient with a graphic tablet and stylus could make the following changes directly in CorelDRAW by using a scan of the sketch as an underlay and drawing over it. I prefer to use pen and ink, and a light table"; most of the final image was traced by hand in ink. Later the line-drawing image was scanned at 600 dpi, cleaned up in a paint program, and then automatically traced with a program.[1] Once the black and white image was in the graphics program, some other elements were added and the figure was colored.

Similarly, Ploch recreated a design from a digital photograph. The JPEG was imported and some "basic shapes" were traced by hand and colored in the graphics drawing program; more complex shapes were handled differently. Ploch used a bitmap editor to remove the background and crop the more complex image components. He then printed the image and traced it by hand onto tracing paper to get a clean black and white line drawing. That drawing was scanned and then vectorized with a program.[2]

Automatic

Some programs automate the vectorization process. Example programs are Adobe Streamline (discontinued), Corel's PowerTRACE, and Potrace. Some of these programs have a command line interface while others are interactive that allow the user to adjust the conversion settings and view the result. Adobe Streamline is not only an interactive program, but it also allows a user to manually edit the input bitmap and the output curves. Corel's PowerTRACE is accessed through CorelDRAW; CorelDRAW can be used to modify the input bitmap and edit the output curves. Adobe Illustrator has a facility to trace individual curves.[3]

Automated programs can have mixed results. A program (PowerTRACE) was used to convert a PNG map to SVG. The program did a good job on the map boundaries (the most tedious task in the tracing) and the settings dropped out all the text (small objects). The text was manually re-inserted.

Map in PNG format (13 kB)
Map after automated conversion and touch up to re-add the labels and adjust colors (18 kB)

Other conversions may not go as well. The results depend on having high-quality scans, reasonable settings, and good algorithms.

Scanned images often have a lot of noise. The bitmap image may need a lot of work to clean it up. Erase stray marks and fill in lines and areas.

Corel advice: Put the image on a light table, cover it with vellum (tracing paper), and then manually ink the desired outlines. Then scan the vellum and use an automated raster-to-vector conversion program on that scan.

Options

Although these lines may look solid, they are far from perfect. The lines were drawn on vellum with a fountain pen, a 0.7 mm gel pen, and a 0.5 mm HB pencil. The images were scanned at 600 pixels per inch with 24-bit RGB. The line widths end up being 10 to 14 pixels wide. The ink colors are not uniform and have specular reflections that put light pixels within the lines. The pencil lines also have interior defects due to the roughness (tooth) of the paper. The scan also has some unsharp masking artifacts.

There are many different image styles and possibilities, and no single vectorization method works well on all images. Consequently, vectorization programs have many options that influence the result.

One issue is what the predominant shapes are. If the image is of a fill-in form, then it will probably have just vertical and horizontal lines of a constant width. The program's vectorization should take that into account. On the other hand, a CAD drawing may have lines at any angle, there may be curved lines, and there may be several line weights (thick for objects and thin for dimension lines). Instead of (or in addition to) curves, the image may contain outlines filled with the same color. Adobe Streamline allows users to select a combination of line recognition (horizontal and vertical lines), centerline recognition, or outline recognition.[4] Streamline also allows small outline shapes to be thrown out; the notion is such small shapes are noise.[5] The user may set the noise level between 0 and 1000; an outline that has fewer pixels than that setting is discarded.

Another issue is the number of colors in the image. Even images that were created as black on white drawings may end up with many shades of gray. Some line-drawing routines employ anti-aliasing; a pixel completely covered by the line will be black, but a pixel that is only partially covered will be gray. If the original image is on paper and is scanned, there is a similar result: edge pixels will be gray. Sometimes images are compressed (e.g., JPEG images), and the compression will introduce gray levels.

Many of the vectorization programs will group same-color pixels into lines, curves, or outlined shapes. If each possible color is grouped into its object, there can be an enormous number of objects. Instead, the user is asked to select a finite number of colors (usually less than 256), the image is reduced to using that many colors (this step is color quantization), and then the vectorization is done on the reduced image.[6] For continuous tone images such as photographs, the result of color quantization is posterization. Gradient fills will also be posterized.[7]

Reducing the number of colors in an image is often aided by a histogram. The most common colors may be selected as the representatives, and other colors are mapped to their closest representative. When the number of colors is set to two, the user may be asked to make threshold and contrast settings.[8] A contrast setting looks for significant changes in pixel color rather than a particular color; consequently, it may ignore the gradual color variations in a gradient fill. Once the outline has been extracted, the user can manually reintroduce the gradient fill.

The vectorization program will want to group a region of the same color into a single object. It can do that by making the region boundary exactly follow the pixel boundaries, but the result will be a boundary of often short orthogonal lines. The resulting conversion will also have the same pixelation problems that a bitmap has when it is magnified. Instead, the vectorization program needs to approximate the region boundary with lines and curves that closely follow the pixel boundaries but are not exactly the pixel boundaries. A tolerance parameter tells the program how closely it should follow the pixel boundaries.[9]

The end result of many vectorization programs are curves consisting of cubic Bézier curves. A region boundary is approximated with several curve segments. To keep a curve smooth, the joints of two curves are constrained so the tangents match. One problem is determining where a curve bends so sharply that it should not be smooth.[10] The smooth portions of a curve are then approximated with a Bézier curve fitting procedure. Successive division may be used. Such a fitting procedure tries to fit the curve with a single cubic curve; if the fit is acceptable, then the procedure stops. Otherwise, it selects some advantageous point along the curve and breaks the curve into two parts. It then fits the parts while keeping the joint tangent. If the fit is still unacceptable, then it breaks the curve into more parts.[11]

Some vectorizers are standalone programs, but many have interactive interfaces that allow a user to adjust the program parameters and quickly see the result. PowerTRACE, for example, can display the original image and preview the converted image so the user may compare them; the program also reports information such as the number of curves.[12]

Example

On the right is an illustration showing the operation of the radula in mollusks. The upper portion is mostly a one-pen-width filled outline diagram, but it has a mesh gradient fill along the bottom of the shell and along the bottom of the food. It also has some artistic brushes on the upper left of the shell. The bottom portion of the illustration has four line weights and some small characters; the color fill is simple except for a gradient at the jagged lines.

The 531×879 pixel image was traced; 50 colors were used. Most (if not all) lines were lost; they were turned into black regions, and their effective line widths varied. The black outline around the blue food in the upper part disappeared. The gradient fills and brushed spots were lost to color quantization/posterization; some brush spots disappeared. Some letters survived the vectorization with distortion, but most letters were discarded. Losing the letters is not a big issue; post conversion editing would want to delete the annotation and replace it with text rather than curves. Thin lines crossing at a shallow angle made filled regions, and intersecting outlines of filled regions became confused; see lower right corner. The tracing also has some odd features. Many black outlines touch, so they become large, complicated, objects rather than just outlines for specific regions. Instead of just a background, a rectangular white region separates the two outlined rectangles. The objects labeled op, rp, and rr are not simple layered shapes; the desired result would have rr overlaid by rp which is overlaid by op.

Usage domains

Vectorization is effective on single colored, nongradient input data, like signatures.

Continuous tone images

Vectorization is usually inappropriate for continuous tone images such as portraits. The result is often poor. For example, many different image tracing algorithms were applied to a 25 kB JPEG image. The resulting vector images are at least a factor of ten larger and may have pronounced posterization effects when a small number of colors are used.

See also

References

  1. ^ Pepper 2005, pp. 68–71
  2. ^ Ploch 2005, p. 17
  3. ^ Adobe 1998, pp. 100–101
  4. ^ Adobe 1992, p. 39
  5. ^ Adobe 1992, pp. 40–41
  6. ^ Adobe 1992, p. 53
  7. ^ Adobe (1998, pp. 348–350) discusses color banding in gradient fills.
  8. ^ Adobe 1992, pp. 54–55
  9. ^ Adobe 1992, pp. 59–60
  10. ^ Itoh & Ohno 1993
  11. ^ Schneider 1990
  12. ^ Corel 2005, p. 217
  • Adobe (1992), Adobe Streamline User Guide (version 3 for Windows ed.), Mountain View, CA: Adobe Systems
  • Adobe (August 1998), Adobe Illustrator User Guide (version 8.0 ed.), Mountain View, CA: Adobe Systems, 90012366
  • Corel (2005), User Guide, CorelDRAW X3 Graphics Suite, Ottawa, ON: Corel Corporation, pp. 213–220
  • Pepper, K. N. (2005), "Cartooning with CorelDRAW", in Corel (ed.), CorelDRAW Handbook: Insights from the Experts, CorelDRAW X3 Graphics Suite, Corel Corporation, pp. 64–77
  • Ploch, Michael (2005), "Re-creating vintage designs on t-shirts", in Corel (ed.), CorelDRAW Handbook: Insights from the Experts, CorelDRAW X3 Graphics Suite, Corel Corporation, pp. 12–23
  • Schneider, Philip J. (1990), "An Algorithm for Automatically Fitting Digitized Curves", in Glassner, Andrew S. (ed.), Graphics Gems, Boston, MA: Academic Press, pp. 612–626, ISBN 0-12-059756-X

Further reading

Read other articles:

Emiliano Insúa Informasi pribadiNama lengkap Emiliano Adrián Insúa ZapataTanggal lahir 7 Januari 1989 (umur 35)Tempat lahir Buenos Aires, ArgentinaTinggi 1,79 m (5 ft 10+1⁄2 in)Posisi bermain Bek kiriInformasi klubKlub saat ini VfB StuttgartNomor 2Karier junior Boca JuniorsKarier senior*Tahun Tim Tampil (Gol)2007 Boca Juniors 0 (0)2007 → Liverpool (pinjaman) 2 (0)2007–2011 Liverpool 46 (1)2010–2011 → Galatasaray (pinjaman) 16 (0)2011–2013 Sporting CP 37...

 

Klasemen medaliOlimpiade Musim Panas 1948LokasiLondon, Britania RayaIkhtisarPerolehan medali emas terbanyak Amerika Serikat (38)Perolehan jumlah medali terbanyak Amerika Serikat (84)← 1936 Klasemen medali1952 → Klasemen medali Olimpiade Musim Panas 1948 adalah klasemen medali selama pelaksanaan Olimpiade Musim Panas 1948. Olimpiade ini berlangsung di London, Britania Raya sejak 29 Juli hingga 14 Agustus 1948. Terdapat 4.104 atlet dari 59 Komite Olimpiade Nasion...

 

Danau Tangxun汤逊湖Tangxun Hu, Danau Tangsun, Tangsun Hu, T’ang-sun HuLetakDistrik Hongshan/Distrik Jiangxia, Wuhan, HubeiBagian dariCekungan Sungai YangtzeTerletak di negaraTiongkokArea permukaan> 476 km2 (184 sq mi)Ketinggian permukaan10 meter (33 ft)KepulauanPulau Zanglong (藏龙岛)[1] Danau Tangxun Hanzi tradisional: 湯遜湖 Hanzi sederhana: 汤逊湖 Alih aksara Mandarin - Hanyu Pinyin: Tāngxùn Hú Yue (Kantonis) - Jyutping: tong1seon3 wu4 Danau ...

Tricerro commune di Italia Tempat Negara berdaulatItaliaRegion di ItaliaPiedmontProvinsi di ItaliaProvinsi Vercelli NegaraItalia Ibu kotaTricerro PendudukTotal671  (2023 )GeografiLuas wilayah12,25 km² [convert: unit tak dikenal]Ketinggian141 m Berbatasan denganCostanzana Desana Ronsecco Trino SejarahSanto pelindungSanto George Informasi tambahanKode pos13038 Zona waktuUTC+1 UTC+2 Kode telepon0161 ID ISTAT002147 Kode kadaster ItaliaL420 Lain-lainSitus webLaman resmi Tricerro adalah ...

 

Artikel ini perlu diwikifikasi agar memenuhi standar kualitas Wikipedia. Anda dapat memberikan bantuan berupa penambahan pranala dalam, atau dengan merapikan tata letak dari artikel ini. Untuk keterangan lebih lanjut, klik [tampil] di bagian kanan. Mengganti markah HTML dengan markah wiki bila dimungkinkan. Tambahkan pranala wiki. Bila dirasa perlu, buatlah pautan ke artikel wiki lainnya dengan cara menambahkan [[ dan ]] pada kata yang bersangkutan (lihat WP:LINK untuk keterangan lebih lanjut...

 

Child sexual abuse compliance method Sex and the law Social issues Consent Reproductive rights Homophobia (Criminalization · Capital punishment) LGBT rights (Conversion therapy · Decriminalization · Civil union · Same-sex marriage · Adoption · Intersex · Transgender) Age of consent Marriageable age Pedophile advocacy Deviant sexual intercourse Miscegenation Norms Public morality Antisexualism Ethics Objectification Pornography Laws Prostitution law Red-light district Reproductive right...

Sukrosa, atau gula dapur, tersusun dari glukosa dan fruktosa. Dimer dari asam karboksilat dalam fase uap. Dalam ilmu kimia, dimer adalah senyawa kimia yang terdiri dari dua molekul (disebut monomer) yang identik atau mirip, dan terikat bersama-sama. Kimia Secara umum, dimer merujuk kepada sebuah molekul yang disusun oleh dua subsatuan (monomer) yang identik dan terikat bersama-sama. Monomer-monomer ini dihubungkan oleh ikatan kovalen atau ikatan lain yang lebih lemah seperti ikatan hidrogen. ...

 

PBS member station in St. Louis For the Australian television network, see Nine Network. This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.Find sources: KETC – news · newspapers · books · scholar · JSTOR (September 2018) (Learn how and when to remove this message) KETCSt. Louis, MissouriUnited StatesChannelsDigital: 23 (UHF...

 

Electoral ward in Leeds, England Human settlement in EnglandHeadingley and Hyde ParkHeadingley and Hyde Park highlighted within LeedsPopulation23,783 (2023 electorate)Metropolitan boroughCity of LeedsMetropolitan countyWest YorkshireRegionYorkshire and the HumberCountryEnglandSovereign stateUnited KingdomUK ParliamentLeeds CentralLeeds North WestCouncillorsAl Garthwaite[1] (Labour)Abdul Hannan (Labour)Jonathan Pryor[2] (Labour) List of p...

Presidential library and museum This article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these template messages) A major contributor to this article appears to have a close connection with its subject. It may require cleanup to comply with Wikipedia's content policies, particularly neutral point of view. Please discuss further on the talk page. (February 2022) (Learn how and when to remove this message) This article's to...

 

Thế vận hội Mùa hè lần thứ XThời gian và địa điểmQuốc giaHoa KỳThành phốLos Angeles, CaliforniaSân vận độngLos Angeles Memorial ColiseumLễ khai mạc30 tháng 7Lễ bế mạc14 tháng 8Tham dựQuốc gia37Vận động viên1.332 (1.206 nam, 126 nữ)Sự kiện thể thao117 trong 14 mônĐại diệnTuyên bố khai mạcPhó tổng thống Charles CurtisVận động viên tuyên thệGeorge Calnan   1928 1936   Thế vận hội M�...

 

Artikel ini terisolasi dan sulit untuk dicari, artinya hanya artikel-artikel sejenis dan tertentu saja yang terhubung dengan halaman ini. Bantulah menambah pranala ke artikel ini dari artikel dengan topik yang lebih besar.Fakultas Hukum Universitas MulawarmanLambang Universitas Mulawarman DekanDr. Mahendra Putra Kurnia, S.H., M.H.[1]Staf administrasi11 orang[2]Lokasi0°27′57.1788″S 117°9′21.999″E / 0.465883000°S 117.15611083°E / -0.465883000;...

Sporting event delegationSan Marino at theParalympicsIPC codeSMRNPCSan Marino Paralympic CommitteeMedals Gold 0 Silver 0 Bronze 0 Total 0 Summer appearances2012201620202024 San Marino made its Paralympic Games début at the 2012 Summer Paralympics in London, sending a single, wildcard wheelchair athlete (Christian Bernardi) to compete in the shot put. He did not win a medal.[1][2][3] Full results for San Marino at the Paralympics Name Games Sport Event Score Rank Chris...

 

Aspect of Italian historyYou can help expand this article with text translated from the corresponding article in Italian. Click [show] for important translation instructions. Machine translation, like DeepL or Google Translate, is a useful starting point for translations, but translators must revise errors as necessary and confirm that the translation is accurate, rather than simply copy-pasting machine-translated text into the English Wikipedia. Do not translate text that appears unreliable ...

 

一中同表,是台灣处理海峡两岸关系问题的一种主張,認為中华人民共和国與中華民國皆是“整個中國”的一部份,二者因為兩岸現狀,在各自领域有完整的管辖权,互不隶属,同时主張,二者合作便可以搁置对“整个中國”的主权的争议,共同承認雙方皆是中國的一部份,在此基礎上走向終極統一。最早是在2004年由台灣大學政治学教授張亞中所提出,希望兩岸由一中各表�...

حروب جنوب أفريقيا (1879-1915)معلومات عامةجزء من التاريخ العسكري لجنوب أفريقيا المكان جنوب إفريقيا تاريخ البدء 1879 تاريخ الانتهاء 1915 المشاركون مملكة الزولوجمهورية إفريقيا الجنوبيةالمملكة المتحدة لبريطانيا العظمى وأيرلندا لديه جزء أو أجزاء الحرب الإنجليزية الزولويةحرب البوي�...

 

Villa Rocca Matilde sulla costa di Posillipo Villa Elisa (via Posillipo 45) Per ville di Napoli si intendono qui soprattutto le dimore signorili costruite dal Rinascimento aragonese alla Belle Époque. Esse costituiscono un inestimabile patrimonio di stili architettonici, arte e cultura. Per le ville dei dintorni e della campagna vedere ville della Campania. Indice 1 Storia 2 Le ville rinascimentali nella Napoli aragonese e nel Cinquecento 3 Posillipo: i fasti del Seicento e dell'Ottocento 4 ...

 

博阿埃斯佩兰萨Boa Esperança市镇博阿埃斯佩兰萨在巴西的位置坐标:21°05′24″S 45°33′57″W / 21.09°S 45.565833333333°W / -21.09; -45.565833333333国家巴西州米纳斯吉拉斯州面积 • 总计858.728 平方公里(331.557 平方英里)海拔775 公尺(2,543 英尺)人口 • 總計37,801人 • 密度44人/平方公里(114人/平方英里) 博阿埃斯佩兰萨(葡萄�...

Kosher certification agency Star-K Kosher CertificationCertifying agencyVaad Hakashrut of BaltimoreHeadquarters122 Slade Ave #300, Baltimore, MD 21208Key PeopleRabbi Moshe Heinemann (Rabbinic Administrator)Dr. Avrom Pollak (President)Websitestar-k.org Star-D symbol as found on certified products Star-K Kosher Certification,[1] also known as the Vaad Hakashrut of Baltimore (Hebrew: ועד הכשרות דבאלטימאר), is a kosher certification agency based in Baltimore, Maryland,&#...

 

City in Georgia, United StatesForest Park, GeorgiaCityForest Park city hall FlagSealLocation in Clayton County and the state of GeorgiaForest ParkLocation in Metro AtlantaCoordinates: 33°37′11″N 84°21′57″W / 33.61972°N 84.36583°W / 33.61972; -84.36583CountryUnited StatesStateGeorgiaCountyClaytonGovernment • TypeCouncil-Manager • MayorAngelyne Butler, MPA • City ManagerDr. Marc-Antonie CooperArea[1] • ...