Giter Site home page Giter Site logo

tinyvg / sdk Goto Github PK

View Code? Open in Web Editor NEW
244.0 8.0 12.0 98 KB

TinyVG software development kit

Home Page: https://tinyvg.tech/

License: MIT License

Zig 73.31% C 1.01% JavaScript 1.47% Shell 0.11% Makefile 0.25% C# 23.85%
zig sdk tinyvg zig-package vector-graphics

sdk's Introduction

THIS REPO IS ARCHIVED.

DEVELOPMENT CONTINUES AT

.tvg: Tiny Vector Graphics

Project Logo A new format for simple vector graphics.

Why?

Quoting the german Wikipedia on SVG:

Praktisch alle relevanten Webbrowser können einen Großteil des Sprachumfangs darstellen.

Translated:

Virtually all relevant web browsers can display most of the language specification.

SVG is a horribly complex format, allowing the embedding of JavaScript and other features no sane person ever wants to have in their images. Other relevant vector graphics formats do not exist or don't have a documentation or specification (looking at you, HVIF!).

This project tries to create and specify a new vector format suitable for:

  • Small and medium icons (think toolbar, buttons, …)
  • Low complexity graphics (think graphs, diagrams, …)
  • Embedded platforms (low resource requirements)

Project Goals

Create a vector graphics format that fulfils the following requirements:

  • Binary encoded ✅
  • Small file size (must be smaller than equivalent bitmaps or SVG graphics) ✅
  • Can be rendered without floating point support (suitable for embedded) ✅
  • Can be rendered efficiently with modern GPUs (suitable for PC, games) ✅
  • Supports the following drawing primitives:
    • points / circles ✅
    • lines ✅
    • triangles / polygons ✅
  • Support drawing styles
    • filled ✅
    • outline ✅
    • filled with outline ✅
  • Support
    • flat colors ✅
    • bitmap textures ❌ (won't be included)
    • linear gradients ✅
    • line widths ✅
  • Can use hinting to allow really small rendering (16²) ❌ (won't be included due to increased complexity)

Use Cases

The use cases here are listed to be considered while working on the specification and give the project a shape and boundary:

  • Application Icons (large, fine details)
  • Toolbar Icons (small, simple)
  • Graphs (large structure, no details, text, think graphviz)
  • Diagrams (colored surfaces, text, lines)
  • Mangas/Comics (complex shapes, different line thickness)

Project Status

This project is coming close to finishing Version 1 of the format, and the written spec is the last thing missing.

See the following documents:

See also this image to have a preview of what is already implemented:

Preview

Milestones

  • Create prototype implementation
  • Finalize prototype
    • Add smaller/bigger colors (16 bit, 30 bit)
    • Add color space information (the color space is defined as sRGB)
    • Add extended coordinate space (32 bit coordinates)
    • Encode primary style in command, reduces command to 63 variants, allows bigger encoding
  • Improve rendering
    • Add anti-aliasing
    • Add missing line width modifier for path rendering
    • Improve rendering performance
    • Move anti-aliased rendering into core library
  • Implement textual representation
    • Convert to .tvg
    • Convert to text
    • Format text
    • Convert to SVG
  • Add auxiliary tools
    • C Library frontend
    • Build SDK
      • Zig package
      • Native packages
        • dynamic macOS x86_64, aarch64
        • static macOS x86_64, aarch64
        • dynamic Windows x86_64
        • static Windows x86_64 (TODO: Linker error with COMDAT when using VS)
        • dynamic Linux x86_64, aarch64, arm
        • static Linux x86_64, aarch64, arm
    • Wasm Polyfill
  • Improve website
    • Add manual to tools
    • Add tiger.tvg example file
    • Add comic.tvg example file
    • Add charts.tvg example file (pie, line and bar chart)
    • Add app-icon.tvg example file
    • Add graph.tvg example file
    • Add text file spec/examples
    • Fix polyfill (change CI)
  • Benchmark Suite
    • File Size (SVG vs. TinyVG)
    • Update final benchmark
  • Sort github issues
  • Write specification
  • Review specification
  • Release!
  • Lock the specification into Version 1.

Future Tasks

  • Convert from SVG (via external tool)
    • SVG <ellipse>
  • (Fill|Draw|Fill Outlined) Ellipse/Circle opcode
  • Smooth Bezier (via mirror behaviour)
  • Inkscape Plugin
  • library/sdk feature: convert TinyVG to draw lists/commands

Resources

  • CSS Gradients
    • Radial and conic gradients can be used for nice 3D shading
  • Previous Work: TurtleFont is a pure line-drawing vector format
  • SVG Path Editor, a tool to easily design or inspect SVG paths

sdk's People

Contributors

david-vanderson avatar deecellar avatar dweiller avatar lukewilliamboswell avatar vancluever avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sdk's Issues

Covnerter: Handle "currentColor"

Observed this being used in some SVGs saved in Inkscape, might not be something that's actually coming from there specifically but possibly some other conversion (e.g. FontForge). Currently, it's unhandled, which sets the image to use magenta, which can hide some other things like alpha issues when checking against images.

Support for embedded system

Would it be possible to add a partial rendering function to TinyVG?
Typically, on embedded system, we don't have enough memory to store complete picture buffer in memory. So most system simply call the drawing loop multiple time, each time with a different drawing window.

Applied to a vector format, it means adding a "top/bottom/left/right" clipping to the rendering function so the rendering only happen within the same buffer, but a different output area of the image. That buffer is then transferred to the screen, and the rendering is called again with the next window.

Add gpu rendering helper

Currently, only a software renderer is provided. This should be changed in a way that the SDK supports exporting GPU usable data (export set of triangles).

This feature should provide:

  • Exporting a set of triangle data
  • Export a set of material definitions/draw calls
  • Allow configurable precision for triangulation of round shapes
  • Agnostic to rendering api (support Vulkan, OpenGL, DirectX, …)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.