Comments (8)
Image filters take an image source, canvas is an image source.
So you can use canvas .getElement() as if it were an image and filter it.
from fabric.js.
Try using the after:render canvas hook to do that
You can use the image filter logic
from fabric.js.
Can you please share how image filter thing would be using after:render? i am not familiar with that.
from fabric.js.
I am not getting your last comment and I searched but could not found the example so would you mind sharing the actual code please? I am looking for example using fabric js way in webgl.
from fabric.js.
To be clear your description is very confusing and is unclear what you want to achieve.
FabricJS does not support filters on objects different than images ( even if a pr for that exists and at some point it will be integrated ).
Is unclear if you want to apply that dynamically or just on some kind of export and what kind of performances do you expect.
For objects that mutate quickly uploading the pixels to the gpu is slow so performances aren't great.
The first thing you can do is clone your objects as image and filter then the images.
If you want to apply the filter to the canvas surface you have to do some kind of more elaborate hack involving a proxy fabricImage and an after:render event and some more stuff. Not going to explain that if i m not sure that is what you look for
from fabric.js.
@asturur
i have some sliders and i need to adjust brightness/contrast upon users changing that slider value but i don't want to export whole image via some function like toDataUrl()
and apply filter on that exported image.
I have already read this thing but not sure if something better exists than this.
https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/filter
I need filter for whole canvas. I can't better explain than this.
Also, let's say if object is something else(text) other than the image, it should be that only after applying filter and not image. So iterating over everything and adding them back as image and apply filter is too long and would not work as well.
Let me know if fabric js can change like that for whole canvas if something is available on fabric's native code.
from fabric.js.
@asturur
I need something like this which applies filter to everything below it (even to the background itself).
from fabric.js.
Provide me a jsfiddle or a codesandbox ( that works ) with a simple canvas and a rect and a text and i ll see if i can make an example
from fabric.js.
Related Issues (20)
- TypeError: Cannot read properties of undefined (reading 'getRetinaScaling') - How to Resolve?
- [Feature]: i want to create a drawing tool which work like the attached video HOT 2
- [Bug]: [Group Flip] Scaling Flip Group then Scaling Flip its child object, the child object behavior is wrong HOT 4
- [Feature Request]: Gradient not apply to underline,overline and linethrough on Text. HOT 4
- [Bug]: shadow appears on the upper side, and the underline displays on the backside of a Textbox when objectcaching is false
- is there any way select an transparent polygon or a fabric object with out using the perPixelTargetFind ?
- i cant select a fabric object when its color is transparent with out use perPixelTargetFind , i cant use perPixelTargetFind in my project because of the so many polygon objects aligned closely so i cant use that , is there any other way to select the transparent object ?
- [Bug]: My canvas like a drawing page here im facing an issue that i draw a polyline in down and them i want show the preview of the line when mouse move and the preview showing fine but when i zoom with mouse wheel the preview getting disappear , then mouse wheel down the canvas zoom back to default state the preview showing fine only when the canvas zoom is greater than default state the polyline preview getting disappearing , i cant solve the issue please give me any solution for that
- [Bug]: Main website SSL issue HOT 3
- [Bug]: Abort signal not propagated from loadFromJSON() to objects in Group HOT 2
- [Bug]: can not use fabricjs with web-worker HOT 7
- he controlls point is not valid, i can`t scale the size by the controlls points HOT 2
- When I apply filters on canvas Image it reduce the image width HOT 3
- [Bug]: `Group.prototype.getObjectsBoundingBox` is no longer available in version v6 rc1
- [Bug]: Textbox does not wrap word when their is no space in words. HOT 1
- [Feature]: Interaction Based on Visual Layering Order HOT 1
- [Feature]: Undo Redo for EraserBrush HOT 1
- [Bug]: hidden textarea make parent overflow hidden div scroll when editing
- CharSpacing not working with textbox object.
- [Bug]: Overwrite fabric.util.createClass for Textbox not working in latest version
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fabric.js.