Login
You're viewing the ruby.social public feed.
  • Nov 13, 2022, 3:01 PM

    Today, while I wait for the cricut to do its thing, lets talk about SVGs as an image format.

    You may have heard of them called a vector format. This means that instead of defining a grid of pixels and having about what colour every pixel is, it defines the features of the image.

    There is a red line from 12,45 to 26,78
    The text "hello" is in front ariel, 14pt and blue
    etc.

    The advantage of this is you can scale the image with out losing any quality. Hence the name Scailable Vector Graphics

    💬 2🔄 3⭐ 0

Replies

  • Nov 13, 2022, 3:05 PM

    If you double the size of the image you still have a red line, the edges of it will still be just as crisp, unlike if you double the size of a raster image, you end up with 4 pixels for every one in the original, it starts to look blocky unless you do some magic maths to add extra information where there wasn't before. AKA, make stuff up.

    💬 1🔄 0⭐ 0
  • Nov 13, 2022, 3:13 PM

    Internally an svg file is an xml document. Just like any webpage you view its a series of "tags" which tell your computer what to display. There are a lot of similar consepts too, both have text, links, ids, even css.

    SVGs have lines, rectangles, circles. You can draw almost anything as an SVG, but it can be a little more complex than painting a raster image.

    A screen shot of an svg image opened in a text editor, showing the xml tags and ending with a series of path tags.
    💬 1🔄 0⭐ 0
  • Nov 13, 2022, 3:17 PM

    Instead of div tags to group bits of an html document you have g or group tags. This is almost always just an ease of use thing rather than actually meaning anything in the picture. You can apply transformations and styles at the group level though to make your life easier. "rotate all of these things by 60 degrees" or "make all the lines red and fill with green"

    💬 1🔄 0⭐ 0
  • Nov 13, 2022, 3:23 PM

    Where the svg language gets away from xml is in the definitions of paths and lines. Paths are a series of points joined by lines or curves. Once you start to deal with curves in computers things start to get complex. Mathimatically there are a bunch of different ways to define curves. Some based on circles, some based on bezier curves, which a bunch of helpful shortcuts.

    If you want to know more Mozilla's documentation on SVG's is excellent.

    developer.mozilla.org/en-US/do

    💬 2🔄 0⭐ 0