Deterministic In-Browser Vectorization & Scalable Vector Graphics Synthesis Engine
Launch C2Vector Studio β’ Algorithm Workflow β’ About & FAQ
C2Vector is a high-precision, client-side vector synthesis application and Progressive Web App (PWA). It converts raster images (PNG, JPEG, WebP, AVIF), logos, camera photographs, and monograms into mathematically rigorous, infinitely scalable W3C SVG 1.1 vectors and master print-ready vector PDF suitesβexecuting 100% inside your browser's native Web Workers.
Most online vectorizers suffer from one of three fatal flaws:
- Predatory Cloud Paywalls: Forcing subscriptions or holding your high-resolution exports hostage.
- Cloud Privacy Leaks: Uploading private company logos, sensitive intellectual property, or personal photos to opaque remote servers.
- Generative AI Hallucinations: Wrapping uncalibrated diffusion or machine-learning models that distort straight lines into wavy noodles, smudge sharp corners, and invent phantom contours.
C2Vector guarantees 0% Generative AI and 100% Mathematical Determinism. Every vector curve, color plate, and boundary is calculated using peer-reviewed computer vision algorithms running entirely in local device memory.
- All processing occurs in dedicated browser Web Workers (
worker.js). - Images never travel across the network to any server, bucket, or third-party API.
- All in-memory buffers and ImageData representations are immediately reclaimed when the browser tab is closed.
-
90-Degree Corner Preservation: Tightened straight-line tolerance (
optTolerance: 0.08) and aggressive corner retention (alphaMax: 0.15) ensure crisp right angles on corporate branding, sharp brackets, and geometric marks. -
Dual-Pass Glyph & Stroke Optimization: For hand-drawn line art and intricate illustrations, a two-pass Connected Component Labeling (Union-Find) mask calibrates stroke thickness within Β±0.5% of master line weight while preserving compact micro-glyphs, handwriting, and fine dots with smooth
$G^1$ cubic BΓ©zier curves (alphaMax: 0.72,optTolerance: 0.10). - Exact Alpha Mask & Alpha-Bounded Color Trapping: Directly preserves 100% of external and internal transparent cutouts (typography counter loops, filigree, negative space) while sealing adjacent color seams with 1px alpha-bounded trapping.
- Adaptive Natural Spot Color Discovery: Clusters anti-aliased transition pixels into dominant spot colors (up to 32 inks) without artificial color clipping, plus 1-Click Transparent Background Knockout.
Decomposes input graphics into production-ready manufacturing layers:
- 1-bit Otsu Monochrome Silhouette: Variance minimization for pure high-contrast vinyl cutting.
- 2-Tone Duotone Print Plate: Clean Key Dark & Midtone ink separation for screenprinting and editorial graphics.
- 4-Tone & 8-Tone Tonal Plates: Progressive density plates calibrated via Tone Match Index (TMI).
- Inverted Plates: Negative print suites optimized for dark apparel printing and laser engraving.
- Bridge-Connected Cut Stencils: Structural bridges preventing "island fallout" during physical cutting.
- In-browser compilation using
jsPDFandsvg2pdf.js. - Exports an Executive Cover Page plus all 12 vector plates into a single 13-page master PDF document (
<source>_<mode>_master_suite_c2vector_DV.pdf), with consistent dynamic filenames for individual SVGs and scaled PNGs (@1x,@2x,@4x). - 100% Pure Vector BΓ©zier Streams: Infinite print scalability with strictly 0 raster compression artifacts.
- Crisp Native ViewBox Zoom (1xβ8x): Hardware-smooth pan, touch-drag, wheel zoom, soft boundary clamping, and dedicated Center control that preserves active magnification without GPU raster blur.
- 13 Specialized Artboards: Rapid switching between Vibrant v2, Faithful Master, 8-Tone Color, Pixel Match, 1-Bit Mono, 2-Tone Duotone, 4-Tone/8-Tone Positive & Negative Plates, Bridge Stencil, Canny Hairline Edges, and Chromatic Contours with strictly 0.00px Layout Shift (CLS).
- Dynamic Swatch Palette: Real-time hex color swatches with one-click clipboard copying and toast feedback.
- Caches all runtime assets via Service Worker (
sw.js). - Installable as a standalone app on macOS, Windows, Linux, Android, and iOS.
- Multi-aspect ratio OpenGraph card suite (<100KB) and Google Search Central multiple-of-48px favicons.
graph TD
A["Raw Input Image (PNG/JPEG/WebP/AVIF)"] --> B["Step 1: Bicubic Resampling & Bilateral Filter"]
B --> C["Step 2: Tonal Decomposition & Otsu Thresholding"]
B --> D["Step 3: Sub-Pixel Canny Edge Gradient Filter"]
B --> E["Step 4: CIELAB Color Space Quantization"]
C & D & E --> F["Step 5: Potrace Continuous BΓ©zier Spline Fitting"]
F --> G["Step 6: Translucent Chromatic Glaze (70-80% Opacity)"]
G --> H["Master Scalable SVG Vectors"]
G --> I["Master Vector PDF Compilation (Pure BΓ©zier)"]
- Step 1 β Resampling & Bilateral Edge-Preserving Smoothing: High-order bicubic Hermite interpolation upscales input images to 4x resolution. A bilateral filter applies Gaussian spatial and photometric domain weighting: $$\text{BF}[I]p = \frac{1}{W_p} \sum{q \in S} G_{\sigma_s}(|p - q|) , G_{\sigma_r}(|I_p - I_q|) , I_q$$
-
Step 2 β Tonal Studies & TMI Calibration:
Decomposes lightness into discrete tonal thresholds using Otsu's variance minimization and checks Tone Match Index (
$TMI \ge 0.88$ ) for monotonic luminosity grading. -
Step 3 β Sub-Pixel Canny Edge Gradients:
Calculates horizontal and vertical Sobel gradients (
$G_x, G_y$ ), detects local intensity maxima along gradient directions, and applies hysteresis thresholding ($T_{\text{low}}, T_{\text{high}}$ ) to generate 1-pixel hairline boundary contours. - Step 4 β CIELAB Quantization: Maps RGB pixels into perceptually uniform CIE $L^a^b^$ color space. Computes Delta E differences ($\Delta E_{ab}^$) to group anti-aliased transition pixels into distinct tonal plates without chromatic muddying.
-
Step 5 β Schneider-Ramer-Peucker & Potrace Curve Tracing:
Traces boundary polygons, determines optimal knot vectors, and fits continuous cubic BΓ©zier splines maintaining
$G^1$ geometric continuity:$$\mathbf{B}(t) = (1-t)^3 \mathbf{P}_0 + 3(1-t)^2 t \mathbf{P}_1 + 3(1-t) t^2 \mathbf{P}_2 + t^3 \mathbf{P}_3, \quad t \in [0, 1]$$ - Step 6 β Multi-Page Vector PDF Export: Compiles SVG vector streams into PDF drawing commands via Skia/PDF geometry primitives in local client memory.
c2vector/
βββ public/ # Static unbundled assets copied directly to dist/
β βββ favicon.ico # Standard root favicon
β βββ manifest.webmanifest # Progressive Web App manifest
β βββ sw.js # Offline Service Worker cache (c2vector-v12)
β βββ robots.txt # Search crawler directives
β βββ sitemap.xml # Canonical clean XML sitemap
β βββ .nojekyll # GitHub Pages static asset bypass
β βββ assets/
β β βββ icons/ # Favicon suite (48, 96, 192, 512, apple-touch)
β β βββ og/ # Multi-aspect OpenGraph cards (<100KB)
β β βββ sample_logo.png # Built-in demo logo graphic
β β βββ sample_photo.png # Built-in demo photography artwork
β βββ vendor/
β βββ jspdf.umd.min.js # Client-side PDF generator
β βββ svg2pdf.umd.min.js # SVG-to-PDF geometry converter
βββ scripts/
β βββ suite.mjs # Unified automated verification, privacy audit & OG card CLI
βββ src/
β βββ css/
β β βββ style.css # Universal design system (Amber/Obsidian theme)
β βββ js/
β β βββ app.js # Application coordinator, UI events, native ViewBox pan-zoom
β β βββ engine/
β β β βββ bezier-tracer.js # Continuous cubic BΓ©zier SVG builders
β β β βββ image-ops.js # Bicubic resampling, bilateral denoise & Canny edge detection
β β β βββ logo-engine.js # Dedicated Logo, Typography & Line-Art vector engine
β β β βββ pipeline.js # Systematic 6-step photographic vector orchestration
β β β βββ potrace.js # Client-side Potrace curve & subpath fitting port
β β β βββ quantizer.js # CIELAB Delta E color science & median-cut quantization
β β β βββ tonal-studies.js # Otsu 1-bit, exact alpha mask, stencil & dual-pass line art
β β β βββ worker.js # Background Web Worker sandbox
β β βββ export/
β β βββ pdf-builder.js # 13-page pure vector PDF suite compiler
β β βββ png-exporter.js # OffscreenCanvas 1x/2x/4x PNG raster exporter
β βββ vendor/ # Bundled engine vendor modules
βββ index.html # Primary Studio Workbench application
βββ about/
β βββ index.html # Clean URL directory endpoint (/about/)
βββ workflow/
β βββ index.html # Clean URL directory endpoint (/workflow/)
βββ vite.config.js # Vite multi-page build configuration
βββ package.json # Project manifest & npm scripts
βββ README.md # Repository documentation
βββ CONTRIBUTING.md # Contribution guidelines & code quality standards
βββ LICENSE # Official MIT License
βββ SECURITY.md # Security and vulnerability policy
git clone https://github.com/deekshithvodela/c2vector.git
cd c2vectornpm install
npm run devOpen your browser at http://localhost:5173/c2vector/.
npm run build
npm run preview# Run the complete automated test & verification suite:
npm test
# (or: node scripts/suite.mjs)
# Generate luxury OpenGraph social preview card suite:
npm run generate:og
# (or: node scripts/suite.mjs --og)To deploy the production-ready Progressive Web App to GitHub Pages (https://deekshithvodela.github.io/c2vector/):
-
Dedicated Repository (Recommended):
cd c2vector git init git add . git commit -m "feat: release c2vector production suite" git branch -M main git remote add origin https://github.com/deekshithvodela/c2vector.git git push -u origin main
- In GitHub repository Settings
$\to$ Pages, set:-
Source:
Deploy from a branch -
Branch:
main// (root)
-
Source:
- The site will be instantly live at
https://deekshithvodela.github.io/c2vector/.
-
Functional Correctness: 41 / 41 high-signal composite automated Playwright, geometry, transparency, and privacy tests passing (
npm test). -
7-Vector Privacy & Leak Hygiene: Verified 0 exposed local developer paths, 0 internal agent metadata paths, 0 private IPs, 0 hardcoded secrets, and 0 unstripped sourcemaps across both
src/and compileddist/. -
Accessibility (WCAG 2.2 Level AA): High-contrast ratios (
$\ge 4.5:1$ ), complete keyboard navigation, explicittype="button"on all interactive buttons,aria-hiddendecorative SVGs, andprefers-reduced-motionsupport. - Performance: Sub-second First Contentful Paint (FCP), hoisted early font preconnects, Web Worker offloaded CPU tasks, and 60fps native ViewBox pan/zoom.
-
Security: Zero runtime npm dependencies, zero DOM XSS vectors (
eval()/new Function()), explicit HTTPS protocols,rel="noopener noreferrer"on all external links, and character entity encoded contact emails. -
Clean URLs: Universal directory routing (
/,/about/,/workflow/) without.htmlextensions.
Designed and engineered with mathematical determinism by Deekshith Vodela.
- Website: https://deekshithvodela.github.io/c2vector/
- LinkedIn: Deekshith Vodela
- Newsletter: Substack
- GitHub: @deekshithvodela
This project is licensed under the MIT License. See the LICENSE file for details.
Copyright (c) 2026 Deekshith Vodela
