(评论)
(comments)

原始链接: https://news.ycombinator.com/item?id=40180821

该用户表达了他们对 SVG(可扩展矢量图形)的迷恋,这是一种允许通过 CSS 实时修改图形元素的多功能格式。 他们分享了利用自托管应用程序或在线编辑器在不涉及浏览器的情况下快速将 SVG 转换为其他格式的经验,并通过 svgomg 等工具增强优化。 用户还提到为有问题的图像创建 SVG 轮廓并实施高斯模糊滤镜而不是传统的图像滤镜。 尽管它很强大,但他们承认艺术家和开发人员经常低估 SVG 的潜力,并讨论他们对 PhpStorm、SVGOMG 和专有软件等工具的偏好。 此外,他们还描述了在基于 Web 的机器人地图应用程序中使用 SVG 并使用 CSS 变量动态设计它们。 他们对比了 ChatGPT 在处理复杂的 SVG 绘图任务方面的有限能力,同时赞扬了它在 SVG 图形中生成复杂动画和过滤器方面的帮助。

相关文章

原文


> I use the same tool a lot for the exact same reason. Really wish the 'mainstream' desktop SVG editors had this level of control of path data.

Inkscape is open source, file a feature request?



I've had this one in my bookmaeks as well for more than 5 years :)

Worth noting it deems itself "SVGOs missing GUI" (and does a splendid job at that). If one needs to batch process files or sth like that, svgo's CLI is still there.

Props to Jake Archibald!



Congrats! It's really cool.

In most of the examples, there's many paths with long sequences of numbers, so it's not obvious which path corresponds to which shape in the image.

I wonder if you could make it temporarily change the color or outline of a path when the cursor is on its code in the editor? (and similarly for text selections)



Wow! I just fiddled with it a little bit and it seems very useful for when I finally decide to tackle the small problems[1] that I encounter with the SVG's that I use. The UI is easy to understand and it gives clear feedback on changes. I definitely bookmarked this.

[1] The problems that I had with some SVG's is that they seemed to stretch the page wide while loading (in a flash) and then finally settling on their intended size after a split second. I remember that I searched for solutions and fiddled with viewbox, widht and height, but to no avail (they were in the hundreds of pixels). What can I do to mitigate this initial 'stretch'?



I’d be curious to see if you could convert svg to another format on the fly faster than the browser does. From my layman perspective that behavior sounds like initializing a bitmap to a max size and then parsing the svg into it.


I don't know about any bitmaps in my code, but I definitely should look into it, as it feels like it should be solvable, especially with SVGs. I opted for SVGs so I could give my icons the user-selected background color with CSS.


maybe something like: your canvas is set to an initial size and then a smaller SVG is drawn inside it. When that's saved for display the resulting .png isn't the same size as the canvas so the browser moves things around a little?

What would happen if you started your SVG output by drawing a canvas-dimensioned border?



SVGs are just so powerful. Last week there was a problem with a parallax transparent image with a filter: drop-shadow looking awful on mac safari and ios. Solution was to create an outline of the image in an SVG and use an svg filter with feGaussianBlur for a drop shadow. I feel like I'm only scratching the surface on what's possible with them. I've been using svgomg for my optimizations, but this looks to have quite a bit more useful features.


> I feel like I'm only scratching the surface on what's possible with them.

I started down a Qt/QML desktop frontend path that led into wondering how much of it I could do with just a SVG imagemap-style setup.

Getting Jupyter up and running with a connection to data and SVG tools was an illuminating experience.



I love this site, I’ve used it countless times. So useful and super quick to see results and just understand weird svg elements

Thank you to the dev



Excellent. I love that the link takes you straight to the editor, browser keeps the history, clear design, a joy to use. Made me click around just to see who did it so I can applaud a job well done.


Excellent --

The library of SVGs on the left is a great feature in itself. I wish a couple of sites like this become super popular so that all of us can both contribute and utilize great vector art.



This is my favorite resource / tool for messing with SVGs. I've looked around a lot and I can't find better. Thank you to the creator.


Doesn't "optimize"

I was expecting the optimization feature to rewrite the SVG to be smaller (less kb).

All the optimize button did was remove whitespace & cartridge returns.



From the terms of service: “You agree not to reproduce, duplicate, copy, sell, resell or exploit any portion of the Service, use of the Service, or access to the Service without SVGViewer's express written permission.” (https://www.svgviewer.dev/terms)

Apart from that, they let you store and share SVGs on their servers, so it’s not purely client-side.



Good thing this doesn't apply to fair use, which allows you to have an offline copy for yourself (assuming it isn't for commercial purposes, and you can make your own offline copy).


Even if it were a plain HTML page, or a simple, single-file Javascript web app, that could either be hosted on a remote server that you don't control (as this is), or can be downloaded and hosted on your own computer or server allowing you to modify it.

And although that sort of thing would mean you can just download it straight from where it's being hosted from a technical point of view (for things where there isn't any backend or hidden logic in code at all) there's still the legal question as shown in logic8's comment.



I didn’t mean it’s a bad question, I just assumed they thought there was a server process involved. But yeah you can self-host a static JS app easily, or put it on GitHub Pages or whatever, if you’re worried about it going offline.


Really nice tool. It has a lot in one place. Normally I use phpStorm and that does not have SVGOMG style optimisation things but the code prettifiers work.

This could do with some better examples to start editing with, using different primitives than just path. A grid would be nice too.

Examples, a search icon is a 'circle' and a 'line' with a 'viewbox' to get right, if you place the origin in the centre of the circle then you don't need x and y values, just a radius. In this way a silly level of optimisation can be made.

A typical search icon will have hundreds of points defined with 'NASA numbers' (six decimal places) and that mashed into a path. Really you just need a circle defined in integers, not Adobe Illustrator exported nonsense.

SVG is an artistic medium and I really like it. However, artists don't see it that way and neither do developers. Hence most SVGs are not really in the spirit of what is possible. It is more than just a file format.



They seem to have gone the Subscription Model. I thought, for $10, I'd buy and keep it as I need them a few times a year. I still love Monodraw for being that tool I bought, kept it, use it a few times, but rarely and happy with it.


I’ve been using SVGs in my robot mapping software and it’s amazing how powerful they are. I design them using css custom properties (variables) so that I can style icon colours, borders, etc. at runtime.


Proprietary so I unfortunately can’t show, but I develop a Web-GIS for lidar mapping of warehouse environments, annotating the space for driving rules (urban planning / Sim City), and real-time site monitoring/issue fixing (like an RTS strategy game) for >10k robots worldwide.


You can probably use ChatGPT to generate SVGs from a description of what you want. Like stable diffusion for simple vector graphics. Maybe even animations.

Haven’t yet done it myself and can’t verify right now, but I wouldn’t be surprised if it worked well to brainstorm a favicon or some other symbol.



ChatGPT does not have the strong understanding of the connection between ideas and 2D/3D space to draw anything with SVG. It’s limitations in this regard are quite apparent, I don’t think it could even draw a smiley face.


Won’t help for tweaking a logo for an app or adjusting a diagram for a presentation. AI generated images do not have direct control. It’s like trying to do tech support with an elderly relative over the phone.


or you could just use a program you learn once, which works anytime, anywhere, for free.

ill choose the one that i cant get vendor locked out of, or that gives me a different result tomorrow than it does today.



Works well enough for simple shapes, but there's already such a huge amount of free resources (iconbuddy.app) and for paid, I just use a subscription to vectorstock and Illustrator. I don't ever find the need to use ChatGPT. I use ChatGPT for doing stuff like setting up complex gradient animations or filters in SVGs and that works quite well.
联系我们 contact @ memedata.com