Closed technowsky closed 2 days ago
The issue with clipTo is that it can't be nested. If you are not interested in nesting you can still subclass or change the render method of the image and clip with clipTo. The reason why clipPath has a bad effect on images is because it forces caching on an intermediate surface area.
Not sure what many workarounds you tried, but since you didn't mention them i supposed you didn't try tweaking object-caching http://fabricjs.com/fabric-object-caching
This is bug from very long ago (When fabric.js changed clipTo (work fine) to clipPath (quality loss)). I have tried many workarounds from github but no luck.
Version
5.3.0
In What environments are you experiencing the problem?
Chrome
Node Version (if applicable)
None
Link To Reproduction
https://jsfiddle.net/zc98q6nb/26/
Steps To Reproduce
Expected Behavior
Image quality will be the same after adding clipPath
Actual Behavior
Adding clipPath results quality loss
Without clipPath:![image](https://github.com/fabricjs/fabric.js/assets/87042351/ad0d4c9b-25ea-43bf-b314-73b7c8734749)
With clipPath:![image](https://github.com/fabricjs/fabric.js/assets/87042351/827a513f-3418-41ca-8655-6ffacc02c961)
Error Message & Stack Trace