Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

agnos.is Forums

  1. Home
  2. Linux
  3. today i learned: svg files are literally just html code

today i learned: svg files are literally just html code

Scheduled Pinned Locked Moved Linux
linux
58 Posts 37 Posters 0 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S [email protected]

    I'm not sure that lossy compression on vectors is strictly impossible.

    You can do things like store less colour information and simplify splines so that curves are less complex.

    U This user is from outside of this forum
    U This user is from outside of this forum
    [email protected]
    wrote on last edited by
    #31

    True, in fact I've done so myself (simplifying a curve resulting of hand sketching). Still I'd argue that's not the normal expected behavior of storing the vector file but rather explicitly modifying it.

    1 Reply Last reply
    0
    • B [email protected]

      What was the map used for?

      tasankovasara@sopuli.xyzT This user is from outside of this forum
      tasankovasara@sopuli.xyzT This user is from outside of this forum
      [email protected]
      wrote on last edited by
      #32

      It's a map of fairground lots for a service that takes bookings, bills the customer and deals with providing relevant safety info to authorities. In use again this season 🙂

      B 1 Reply Last reply
      0
      • cypherpunks@lemmy.mlC [email protected]

        for example, on a linux distro, we could modify the desktop environment and make it waaaaay lighter by getting rid of jpg or png icons and just using pure svg on it.

        this has largely happened; if you're on a dpkg-based distro try running this command:

        dpkg -S svg | grep svg$ | sort

        ...and you'll see that your distro includes thousands of SVG files 🙂

        ::: spoiler explanation of that pipeline:

        • dpkg -S svg - this searches for files installed by the package manager which contain "svg" in their path
        • grep svg$ - this filters the output to only show paths which end with svg; that is, the actual svg files. the argument to grep is a regular expression, where $ means "end of line". you can invert the match (to see the paths dpkg -S svg found which only contain "svg" in the middle of the path) by writing grep -v svg$ instead.
        • the sort command does what it says on the tin, and makes the output easier to read

        you can run man dpkg, man grep, and man sort to read more about each of these commands.
        :::

        M This user is from outside of this forum
        M This user is from outside of this forum
        [email protected]
        wrote on last edited by
        #33

        Is this the same as pacman -Ql?

        1 Reply Last reply
        0
        • tasankovasara@sopuli.xyzT [email protected]

          It's a map of fairground lots for a service that takes bookings, bills the customer and deals with providing relevant safety info to authorities. In use again this season 🙂

          B This user is from outside of this forum
          B This user is from outside of this forum
          [email protected]
          wrote on last edited by
          #34

          Yo that’s super cool! My nerd brain went straight to a virtual table top map for D&D

          1 Reply Last reply
          0
          • P [email protected]

            litghter, as in smaller, yess. but keep in mind, that vector graphics need to be rendered, wich depending on circumstance and graphic might become inefficient.

            i never crunched the numbers, but basically youre outsourcing the generation of a rastergraphic to those who open up your website.

            F This user is from outside of this forum
            F This user is from outside of this forum
            [email protected]
            wrote on last edited by
            #35

            Though this also has advantages - not only will they be drawn at an appropriate resolution, they can also be styled & modified by the user. If I'm using Dark Reader and your icons are SVGs using currentColor, they'll render with the same color as other text. The best you can do for raster graphics is inverting them.

            P 1 Reply Last reply
            0
            • adrianhooves@lemmy.todayA [email protected]

              what the heck!! that is so wild, mind blowing, i know the main difference between raster graphics and vector graphics was the quality but not more, i had no idea svg files actually used html code and pretty much could be modified using only text and amazing code woa!!! this opens up the possibility for so many things on linux i think, for example, on a linux distro, we could modify the desktop environment and make it waaaaay lighter by getting rid of jpg or png icons and just using pure svg on it. svg can be given a lot of attributes like movement, mouse hovering, change color, change anything. and most svg files are still under a megabyte. wow.. please let me know other fun facts about svg or eps files. i really like doing graphic design on linux and inkscape.

              S This user is from outside of this forum
              S This user is from outside of this forum
              [email protected]
              wrote on last edited by
              #36

              for example, on a linux distro, we could modify the desktop environment and make it waaaaay lighter by getting rid of jpg or png icons and just using pure svg on it.

              Isn't that how it already works? GNOME system icons are all SVG - that's what allows them to change colors when you change themes or switch between light and dark mode.

              adrianhooves@lemmy.todayA B 2 Replies Last reply
              0
              • chtk@feddit.nlC [email protected]

                XML is a super-set of XHTML's spec.

                That's a weird way of saying XHTML is an application of XML.

                A This user is from outside of this forum
                A This user is from outside of this forum
                [email protected]
                wrote on last edited by
                #37

                You can phrase it however you like?

                ?

                1 Reply Last reply
                0
                • S [email protected]

                  for example, on a linux distro, we could modify the desktop environment and make it waaaaay lighter by getting rid of jpg or png icons and just using pure svg on it.

                  Isn't that how it already works? GNOME system icons are all SVG - that's what allows them to change colors when you change themes or switch between light and dark mode.

                  adrianhooves@lemmy.todayA This user is from outside of this forum
                  adrianhooves@lemmy.todayA This user is from outside of this forum
                  [email protected]
                  wrote on last edited by
                  #38

                  i didn't know that, is that the same in xfce??

                  R 1 Reply Last reply
                  0
                  • cypherpunks@lemmy.mlC [email protected]

                    No, SVG files are not HTML.

                    Please change this post title (currently "today i learned: svg files are literally just html code"), to avoid spreading this incorrect factoid!

                    I suggest you change it to "today i learned: svg files contain code in an html-like language" or something like that.

                    SVG is a dialect of XML.

                    XML and HTML have many similarities, because they are both are descendants of SGML. But, as others have noted in this thread, HTML is also not XML. (Except for when it's XHTML...)

                    Like HTML, SVG also can use CSS, and, in some environments (eg, in browsers, but not in Inkscape) also JavaScript. But, the styles you can specify with CSS in SVG are quite different than those you can specify with CSS in HTML.

                    Lastly, you can embed SVG in HTML and it will work in (modern) browsers. You cannot embed HTML in SVG, however.

                    adrianhooves@lemmy.todayA This user is from outside of this forum
                    adrianhooves@lemmy.todayA This user is from outside of this forum
                    [email protected]
                    wrote on last edited by
                    #39

                    ok thank you very much!!

                    1 Reply Last reply
                    0
                    • A [email protected]

                      technically HTML is not XML.. XHTML is, but HTML can be invalid XML.

                      G This user is from outside of this forum
                      G This user is from outside of this forum
                      [email protected]
                      wrote on last edited by
                      #40

                      It annoys me that you aren't supposed to close input tags. At least browsers tolerate self closing them even if it is out of spec.

                      N 1 Reply Last reply
                      0
                      • S [email protected]

                        for example, on a linux distro, we could modify the desktop environment and make it waaaaay lighter by getting rid of jpg or png icons and just using pure svg on it.

                        Isn't that how it already works? GNOME system icons are all SVG - that's what allows them to change colors when you change themes or switch between light and dark mode.

                        B This user is from outside of this forum
                        B This user is from outside of this forum
                        [email protected]
                        wrote on last edited by
                        #41

                        There are both, PNG as standard sizes and the SVGs. I believe the DE pulls the 32 48 256 pixel pngs so no addition rendering is needed.

                        1 Reply Last reply
                        0
                        • adrianhooves@lemmy.todayA [email protected]

                          what the heck!! that is so wild, mind blowing, i know the main difference between raster graphics and vector graphics was the quality but not more, i had no idea svg files actually used html code and pretty much could be modified using only text and amazing code woa!!! this opens up the possibility for so many things on linux i think, for example, on a linux distro, we could modify the desktop environment and make it waaaaay lighter by getting rid of jpg or png icons and just using pure svg on it. svg can be given a lot of attributes like movement, mouse hovering, change color, change anything. and most svg files are still under a megabyte. wow.. please let me know other fun facts about svg or eps files. i really like doing graphic design on linux and inkscape.

                          B This user is from outside of this forum
                          B This user is from outside of this forum
                          [email protected]
                          wrote on last edited by
                          #42

                          I don't think it would be lighter, SVGs need a rendering tool to read the code and draw the artwork for the vector based images. This has always been slower than just displaying a bmp, jpg, or PNG.

                          R 1 Reply Last reply
                          0
                          • F [email protected]

                            Though this also has advantages - not only will they be drawn at an appropriate resolution, they can also be styled & modified by the user. If I'm using Dark Reader and your icons are SVGs using currentColor, they'll render with the same color as other text. The best you can do for raster graphics is inverting them.

                            P This user is from outside of this forum
                            P This user is from outside of this forum
                            [email protected]
                            wrote on last edited by
                            #43

                            i too love the svg. rest assured. 😉

                            1 Reply Last reply
                            0
                            • cypherpunks@lemmy.mlC [email protected]

                              No, SVG files are not HTML.

                              Please change this post title (currently "today i learned: svg files are literally just html code"), to avoid spreading this incorrect factoid!

                              I suggest you change it to "today i learned: svg files contain code in an html-like language" or something like that.

                              SVG is a dialect of XML.

                              XML and HTML have many similarities, because they are both are descendants of SGML. But, as others have noted in this thread, HTML is also not XML. (Except for when it's XHTML...)

                              Like HTML, SVG also can use CSS, and, in some environments (eg, in browsers, but not in Inkscape) also JavaScript. But, the styles you can specify with CSS in SVG are quite different than those you can specify with CSS in HTML.

                              Lastly, you can embed SVG in HTML and it will work in (modern) browsers. You cannot embed HTML in SVG, however.

                              B This user is from outside of this forum
                              B This user is from outside of this forum
                              [email protected]
                              wrote on last edited by
                              #44

                              You know how they say that the internet is a series of tubes? We used to think that was just a funny old man. Turns out, it is the literal truth. The internet is made up of SVG files!

                              1 Reply Last reply
                              0
                              • B [email protected]

                                I don't think it would be lighter, SVGs need a rendering tool to read the code and draw the artwork for the vector based images. This has always been slower than just displaying a bmp, jpg, or PNG.

                                R This user is from outside of this forum
                                R This user is from outside of this forum
                                [email protected]
                                wrote on last edited by
                                #45

                                It's lighter in memory. on android (development) it has been said for a few years now that it's better to use them for most cases, because android apps tend to use a ton of icons and this way they are small, themable, scaleable (the other option is to include multiple versions with diff resolutions), and can even have animations. it can basically save a lot of space.

                                but of course that will make no difference when the apps are 180 MB, partly because of the same 30 MB native libs being bundled for 4 different CPU architectures, because wasteful the dev didn't bother to produce different APKs for the different kinds of CPUs. and similar project mismanagement things.

                                1 Reply Last reply
                                0
                                • M [email protected]

                                  No, it's XML. It's an ancestor of HTML and, unlike HTML, it can be losslessly converted.

                                  J This user is from outside of this forum
                                  J This user is from outside of this forum
                                  [email protected]
                                  wrote on last edited by
                                  #46

                                  Not quite. XML came several years after HTML! Both are descendants of SGML.

                                  1 Reply Last reply
                                  0
                                  • adrianhooves@lemmy.todayA [email protected]

                                    i didn't know that, is that the same in xfce??

                                    R This user is from outside of this forum
                                    R This user is from outside of this forum
                                    [email protected]
                                    wrote on last edited by
                                    #47

                                    hard to tell, but you can check it:

                                    find / -type f -name *.svg
                                    

                                    maybe also include -xdev if you have any external drive that doesn't hold system files.

                                    1 Reply Last reply
                                    0
                                    • gomp@lemmy.mlG [email protected]

                                      Ommigod, these kids 🙂

                                      SVG comes XML (a more coherent/simple version of the SGML that is behind HTML), and specifically from a time where people took XML and made it hyper-complicated with a flurry of extensions and specifications (look up "xml namespaces" "xslt" "xml schema").

                                      The most apparent difference between SGML and XML is than in the former you write tags like <br> without a corresponding </br>, and in the latter you have to close them like <br/> (which is shorthand for <br></br>).

                                      So... today you learned that what you learned earlier today was close to truth, but not true 🙂

                                      PS: A lot of document formats are undercover/zipped XML (eg. the libre office documents, IIRC microsoft's .xlsx and .docx). This is not dissimilar to how json/yaml are widely used today.

                                      M This user is from outside of this forum
                                      M This user is from outside of this forum
                                      [email protected]
                                      wrote on last edited by
                                      #48

                                      So, my Lemmy app - and I think a lot of Lemmy, renders markdown, so whenever you write "<...>" It disappears for me!

                                      gomp@lemmy.mlG 1 Reply Last reply
                                      0
                                      • cypherpunks@lemmy.mlC [email protected]

                                        No, SVG files are not HTML.

                                        Please change this post title (currently "today i learned: svg files are literally just html code"), to avoid spreading this incorrect factoid!

                                        I suggest you change it to "today i learned: svg files contain code in an html-like language" or something like that.

                                        SVG is a dialect of XML.

                                        XML and HTML have many similarities, because they are both are descendants of SGML. But, as others have noted in this thread, HTML is also not XML. (Except for when it's XHTML...)

                                        Like HTML, SVG also can use CSS, and, in some environments (eg, in browsers, but not in Inkscape) also JavaScript. But, the styles you can specify with CSS in SVG are quite different than those you can specify with CSS in HTML.

                                        Lastly, you can embed SVG in HTML and it will work in (modern) browsers. You cannot embed HTML in SVG, however.

                                        zarkanian@sh.itjust.worksZ This user is from outside of this forum
                                        zarkanian@sh.itjust.worksZ This user is from outside of this forum
                                        [email protected]
                                        wrote on last edited by
                                        #49

                                        I remember when XHTML was supposed to replace HTML. Everything was going to be standardized and web designers would run their HTML code against a validator...it was going to be glorious! And of course it never happened, because demanding that all websites conform to the XHTML standard would've broken a lot of websites.

                                        So, HTML5 ate XHTML's lunch because it was much more forgiving, and...oh yeah, you could watch videos and play games in it, too.

                                        A ? 2 Replies Last reply
                                        0
                                        • zarkanian@sh.itjust.worksZ [email protected]

                                          I remember when XHTML was supposed to replace HTML. Everything was going to be standardized and web designers would run their HTML code against a validator...it was going to be glorious! And of course it never happened, because demanding that all websites conform to the XHTML standard would've broken a lot of websites.

                                          So, HTML5 ate XHTML's lunch because it was much more forgiving, and...oh yeah, you could watch videos and play games in it, too.

                                          A This user is from outside of this forum
                                          A This user is from outside of this forum
                                          [email protected]
                                          wrote on last edited by
                                          #50

                                          I fucking learned a whole-ass language for nothing back then because I thought it was the future!, fuck you, XHTML!

                                          zarkanian@sh.itjust.worksZ ? 2 Replies Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups