Giter Site home page Giter Site logo

Comments (23)

mrbean-bremen avatar mrbean-bremen commented on May 22, 2024 1

Thanks, I will have a look later!

from svg.

mrbean-bremen avatar mrbean-bremen commented on May 22, 2024 1

No problem, I just can't promise anything...

from svg.

megakraken avatar megakraken commented on May 22, 2024 1

it doesn't look that complicated to implement these filters. maybe i'll try to mess around with it a bit...

from svg.

tebjan avatar tebjan commented on May 22, 2024

i have never tried them... could you debug it and make a pull request?

from svg.

mrbean-bremen avatar mrbean-bremen commented on May 22, 2024

Currently, none of the W3C filter examples seems to work.
The filter classes are created dynamically after a class lookup using reflection - though there is no direct call in the code, they are applied, so that is not the reason why they are not working.

from svg.

AnReZa avatar AnReZa commented on May 22, 2024

I'm also affected by this issue. I'm using a matrix transform filter to sharpen parts of the image. Instead, the whole image appears black.

from svg.

mrbean-bremen avatar mrbean-bremen commented on May 22, 2024

Yes, I didn't really look into this until now - I hoped that someone with a better understanding would have a look (like the original developers...). Maybe I will have a go at this sometime later, but this doesn't look like an easy fix.

from svg.

AnReZa avatar AnReZa commented on May 22, 2024

Yes, just by the sheer fact, that this ticket is open for years now, I can estimate, that this isn't trivial to fix. But thank you anyways for your help!

from svg.

mrbean-bremen avatar mrbean-bremen commented on May 22, 2024

I'm using a matrix transform filter to sharpen parts of the image. Instead, the whole image appears black.

Not sure if this is your problem, but if there are floats in your matrix, and you use a (non-English) locale where the decimal point is a comma, there has been a bug in reading the float values (fixed a few days ago).
Anyway, I'm going to have a look at the filter stuff, and if you have a concrete example image of a filter not working, I may have a look at that first.

from svg.

AnReZa avatar AnReZa commented on May 22, 2024

I guess, that this shouldn't be the case here. I've attached one example SVG for you. You can replace the linked picture with anything you like. The image should show a partially sharpened area in the lower right corner.
Test.zip

By the way: This is, how it comes out right now:
142B6799

from svg.

mrbean-bremen avatar mrbean-bremen commented on May 22, 2024

Ok, I can see the original image, but no filter applied.

from svg.

mrbean-bremen avatar mrbean-bremen commented on May 22, 2024

...which is no surprise after checking the implementation: the only implemented filters are feColourMatrix, feGaussianBlur (partly), feMerge and feOffset.

from svg.

mrbean-bremen avatar mrbean-bremen commented on May 22, 2024

These are exactly the ones that are used in one of the example images - __issue-083-01.svg. feGaussianBlur works with one value for stdDeviation, but not with two, and the result image looks different from the one in the browser (less blurred). The other 3 (more basic ones) seem to work correctly.

For reference, the following filter primitives are not implemented:
feBlend, feComponentTransfer, feComposite, feConvolveMatrix, feDiffuseLighting, feDisplacementMap, feFlood, feImage, feMorphology, feSpecularLighting, feTile and feTurbulence.

from svg.

AnReZa avatar AnReZa commented on May 22, 2024

Do you think, that it would be possible to implement feConvolveMatrix, feComponentTransfer and feBlend in a reasonable amount of time? Those are the ones used in my project. Maybe they can be adopted from the Inkscape source code or some other open source SVG rendering engine.

from svg.

mrbean-bremen avatar mrbean-bremen commented on May 22, 2024

Well, it depends on who will do the work, and what is a reasonable amount of time ;)
I started to look at the filter code, but I have no experience there (and not that much free time), so this may take some time, but I cannot say how much at the moment. Any help would be appreciated, of course!

from svg.

AnReZa avatar AnReZa commented on May 22, 2024

Unfortunately I can't help you much. I'm horrible at maths and don't know the code at all.

from svg.

megakraken avatar megakraken commented on May 22, 2024

Has there been any progress with this at all? It would be amazing if we could get more of the filters to work, especially the lighting filters such as feSpecularLighting and feDiffuseLighting are just such a powerful and widely used asset of SVG and it would be awesome if the library supported them.

from svg.

mrbean-bremen avatar mrbean-bremen commented on May 22, 2024

Unfortunately, no progress here. I had abandoned the PR I intialially started, it didn't get anywhere (I actually forgot the details), and so far nobody else has tried this.

from svg.

wieslawsoltes avatar wieslawsoltes commented on May 22, 2024

Has there been any progress with this at all? It would be amazing if we could get more of the filters to work, especially the lighting filters such as feSpecularLighting and feDiffuseLighting are just such a powerful and widely used asset of SVG and it would be awesome if the library supported them.

You can try using https://github.com/wieslawsoltes/Svg.Skia

NuGet: https://www.nuget.org/packages/svg.skia

It's based on this library but requires SkiaSharp.

from svg.

mrbean-bremen avatar mrbean-bremen commented on May 22, 2024

@wieslawsoltes - is #590 still something to consider? It would be a big progress, an would also help this this kind of issues.

from svg.

wieslawsoltes avatar wieslawsoltes commented on May 22, 2024

@wieslawsoltes - is #590 still something to consider? It would be a big progress, an would also help this this kind of issues.

@mrbean-bremen Yes, but not really possible to integrate with Svg.Skia at this point. I would still prefer splitting but preferably via partial classes, not really sure if that would work. I have some ideas, but not much time on hand.

from svg.

mrbean-bremen avatar mrbean-bremen commented on May 22, 2024

Thanks - good to hear that this is still an option! Time constraints are an issue most of us have...

from svg.

megakraken avatar megakraken commented on May 22, 2024

Has there been any progress with this at all? It would be amazing if we could get more of the filters to work, especially the lighting filters such as feSpecularLighting and feDiffuseLighting are just such a powerful and widely used asset of SVG and it would be awesome if the library supported them.

You can try using https://github.com/wieslawsoltes/Svg.Skia

NuGet: https://www.nuget.org/packages/svg.skia

It's based on this library but requires SkiaSharp.

interesting, I will take a look, thank you!

from svg.

Related Issues (20)

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.